reactjs - Nested route using getComponent does not render -
i've been building react app react-router 3.x setup this:
<route component={global}> <route path="/" getcomponent={(loc, cb) => loadroute('home', cb)} /> <route path="/app" component={app}> <indexroute getcomponent={(loc, cb) => loadroute('apphome', cb)} /> <route path="search" getcomponent={(loc, cb) => loadroute('search', cb)} /> </route> </route> i've had working chunking containers within app. loadroute function wraps system.import call adding containers/${name}/index.js.
however, adding dynamic getcomponent={loadroute(...)} app , navigating /app causes global have no children; js chunks app , apphome downloaded nothing mounted.
the loadroute function:
const loadroute = (container, callback) => { return system .import(`containers/${container}/index.js`) .then(module => callback(null, module.default)) .catch(errorloading); };
Comments
Post a Comment