react-swipeable-routes icon indicating copy to clipboard operation
react-swipeable-routes copied to clipboard

Support for code-splitting / lazy loading routes

Open stream7 opened this issue 7 years ago • 3 comments

Hi there,

Any plans to support https://reacttraining.com/react-router/web/guides/code-splitting ?

stream7 avatar Jun 04 '18 16:06 stream7

This actually works right now (not if you are using the Switch component) but it does load all of the chunks at once so I'm going to leave it open for now.

stream7 avatar Jun 05 '18 13:06 stream7

Hello! Yes, this works right now just like you describe. It'd be nice to do lazy loading, let's leave this open. When I have some time I'll try and see what I can do.

sanfilippopablo avatar Jun 05 '18 13:06 sanfilippopablo

Regarding the Switch, you shouldn't use it with SwipeableRoutes. Route components should be direct descendants of SwipeableRoutes, it acts just like a Switch. Maybe I should clarify that in docs.

sanfilippopablo avatar Jun 05 '18 13:06 sanfilippopablo