خرید بک لینک

Vote count: 0

For reference, I am using the React-Redux Starter Kit (https://github.com/davezuko/react-redux-starter-kit) as a base project layout.

Ive got a route named TSP, and I am using getComponent and redux coect() to inject a reducer on a container component, which i am hoping will pass children on in the props.

The getChildRoutes in the TSP route definition is never being called.

Root Router Config:

import ApplicationLayout from '../layouts/ApplicationLayout';
import Home from './Home';

export const createRoutes = (store) => {
  const routes = {
    path: '/',
    component: ApplicationLayout,
    indexRoute: Home,
    getChildRoutes (location, next) {
      require.ensure([], (require) => {
        next(null, [
          require('./TSP').default(store),
          require('./Home').default,
        ]);
      });
    }
  };

  retu routes;
};

export default createRoutes;

Nested Router Config (TSP):

import { injectReducer } from '../../store/reducers';
import Overview from './routes/Overview';

export default (store) => ({
  path: '/tsp/:id',
  indexRoute: Overview,
  getComponent (nextState, next) {
    require.ensure([
      './containers/TSPContainer',
      './modules/tsp'
    ], (require) => {
      const TSP = require('./containers/TSPContainer').default;
      const reducer = require('./modules/tsp').default;

      injectReducer(store, { key: 'tsp', reducer });
      next(null, TSP);
    });
  },
  getChildRoutes (location, next) {
    debugger
    require.ensure([], (require) => {
      next(null, [
        // Provide store for async reducers and middleware
        require('./routes/Offers').default(store),
        require('./routes/Reviews').default(store)
      ]);
    });
  }
});

I am never getting to the debugger within getChildRoutes.

Any help is appreciated, and if there are any more files necessary to see I can add them.

asked 46 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 22 ارديبهشت 1395 ساعت: 6:00

صفحه بندی