sanfilippopablo / react-swipeable-routes

Utility for integrating react-swipeable-views with react-router.
MIT License
75 stars 14 forks source link

Support for code-splitting / lazy loading routes #9

Open stream7 opened 6 years ago

stream7 commented 6 years ago

Hi there,

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

stream7 commented 6 years ago

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.

sanfilippopablo commented 6 years ago

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 commented 6 years ago

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.