react-native-navigation
react-native-navigation copied to clipboard
Support for Expo Modules
🐛 Bug Report
We use wix/react-native-navigation together with Expo, and it works like a charm. However, since Expo upgraded from their react-native-unimodules to Expo Modules, it looks impossible to use these together.
Links:
- https://docs.expo.dev/bare/installing-expo-modules/
- https://blog.expo.dev/whats-new-in-expo-modules-infrastructure-7a7cdda81ebc#7486
Any help on using these together?
https://github.com/kanzitelli/rnn-with-expo
So how to use expo with react-native-navigation?
There should be
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
// INIT https://docs.expo.dev/bare/installing-expo-modules/#configuration-for-android
return new ReactActivityDelegateWrapper(this, new MainActivityDelegate(this, getMainComponentName()));
}
But NavigationActivity
doesn't have createReactActivityDelegate
to override.
So my app is stuck on the first screen.
@Pietro-Putelli Thanks for help, one thing to notice, I was unable to solve any issues until jumped to RN0.70.0, nothing works after 0.67.5, 0.68.0 does not compile for android builds but I successfully compile ios and android with RN0.70.0 and looks like I have another issue with overlay on android, but it is another story for research.
Hi, I was able to install it with npx init and install expo modules too, use version 0.70 and then once run it will ask you to update the version, and from here you can bring the app up to date.
Is there any tutorial somewhere to install expo with react native navigation in react native 0.72+?
@JimTeva I'm having the same issue trying to upgrade to 0.72...any luck? iOS app crashes at launch with *** Terminating app due to uncaught exception 'RCTFatalException: No bundle URL present.
@marcshilling unfortunately I didn't find a solution as it requires a custom integration. I wish @kanzitelli could make a manual on how to do it as he succeeded in making a starter that includes both. @kanzitelli?
@JimTeva to update, I managed to get everything running on RN 0.72! Basically just needed to leave most of the AppDelegate/MainApplication code the same as RNN docs recommend (contrary to what the upgrade helper says). If anyone else needs help, happy to answer any questions.
@marcshilling I'd love some guidance with this, can you point us to the changes that need to take place from a high level so that I can get started with making those changes on our project?
I'd be grateful! Thanks
@SudoPlz https://github.com/kanzitelli/rnn-with-expo is pretty much the correct setup except with RN 0.72 I had to change the AppDelegate lines slightly to this:
RCTBridge *bridge = [self createBridgeWithDelegate:self launchOptions:launchOptions];
[ReactNativeNavigation bootstrapWithBridge:bridge];
@marcshilling my main concern with that implementation is:
-
https://github.com/kanzitelli/rnn-starter/issues/57#issuecomment-1883372245
ReactNativeHostWrapper
is not used at all, that means on Android it's probably not properly integrated -
on iOS it replaces
RCTAppDelegate
withEXAppDelegateWrapper
. But I'm not sure wether this works with fabric, since by doing a quick check,EXAppDelegateWrapper
does not implement the same functionality asRCTAppDelegate
(RCTAppDelegate methods missing from EXAppDelegateWrapper). I could be wrong about this but it's a concern, because we have enabled fabric in our project.
@SudoPlz ah, I'm not using the new architecture so can't help you there...sorry