nandorojo / expo-next-react-navigation

⛴ Make Next.js and react-navigation play nicely together with an Expo/React Native Web app.
408 stars 32 forks source link

Code split and lazy load screens/routes #49

Closed tomsdev closed 3 years ago

tomsdev commented 3 years ago

Hi, to optimize first load size, would it be possible with this integration to code split and lazy load the components of the other screens/routes?

nandorojo commented 3 years ago

Yup.

To lazy load, use the getComponent prop on React navigation's Screen component instead of component.

You can also use my package react-navigation-heavy-screen