mhaagens / lazy-route

Lazy/async route loading for React Router 4 through System.import
57 stars 7 forks source link

Can not use with Switch #4

Closed yezongyang closed 7 years ago

arvigeus commented 7 years ago

Try this for now: <Route render={() => <LazyRoute component={import("myComponent")}>}/>

aldarund commented 7 years ago

@arvigeus isnt it the same as in docs except there no props? I tried same but with props and it doesnt work with switch

pc035860 commented 7 years ago

@aldarund I just send a PR for the support. You can try it on my branch before the PR gets merged.

zanjs commented 7 years ago

@pc035860 https://github.com/ReactTraining/react-router/issues/5411

Thinks you

mlewis-sandow commented 7 years ago

I ran into the same issue. That change resolved it. Thanks @pc035860