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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -