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

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -