javascript - Async IndexRoute doesn't load with react-router -
i can't index route (home component) load, appreciate i'm doing wrong?
my routes.js file looks this
module.exports = <route path="/" getcomponent={(location, cb) => { require.ensure([], (require) => { cb(null, require('./container')) }) }} getchildroutes={(location, cb) => { require.ensure([], (require) => { cb(null, require('./container').childroutes) }) }} getindexroute={(location, cb) => { require.ensure([], (require) => { cb(null, require('./container').indexroute) }) }} />
and container.js file looks this
export default class container extends component { render = () => { return <div> {this.props.children} </div> } } container.childroutes = [ <route path="/:product/get-quote" component={props => <product productname={props.params.product} {...props} />} />, <route path="/:product/processing-quote" component={props => <processingquote productname={props.params.product} {...props} />} /> ] container.indexroute = <indexroute component={home} />
if you're using getchildroutes
, getindexroute
handlers, should use plainroute
configuration objects, rather jsx components.
Comments
Post a Comment