When using Async chunks, you can easily integrate React components which are
part of async chunks, by created a wrapper component
with React.Suspense
and passing it as a component
prop to a Screen
, e.g:
React context is passed to the chunks as well, so you can use useNavigation
, useRoute
and other
hooks inside chunks (e.g: inside StudentSide
or TeacherSide
components) to access data or
interact with React Navigation.
For Scripts approach, there's no easy way to integrate React Navigation. It should be possible to hack your way around it, but in general, we don't recommend scripts approach unless you know what you're doing.
Module Federation approach is not officially supported yet, but it should be fairly straightforward to integrate React Navigation with it. For a reference how it could be done, check out this code: https://github.com/zamotany/module-federation-repack/blob/main/host/Root.js#L51-L86