help needed: Convert uni-modules to expo-modules
See original GitHub issueLooks like Expo has deprecated uni-modules: https://docs.expo.dev/bare/installing-unimodules/ And switched to expo-modules: https://blog.expo.dev/whats-new-in-expo-modules-infrastructure-7a7cdda81ebc
Now I was trying to get it to work for Android with react-native-navigation and i was able to migrate the code to get the app to compile successfully, but with no luck, the navigation is not working.
I think the part where it gets stuck is in MainActivity.java
https://docs.expo.dev/bare/installing-expo-modules/#configuration-for-android
As you can see, the code inside public class MainActivity extends NavigationActivity
is not working and if I omit the code the app is compiled successfully, but the navigation is not working.
The following code is not working
package com.myApp;
import com.reactnativenavigation.NavigationActivity;
import com.facebook.react.ReactActivityDelegate;
import expo.modules.ReactActivityDelegateWrapper;
public class MainActivity extends NavigationActivity {
@Override
protected String getMainComponentName() {
return "MyApp";
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegateWrapper(this,
new ReactActivityDelegate(this, getMainComponentName())
);
}
}
Some help would be appreciated.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top GitHub Comments
I got it working for Android.
In
MainActivity.java
leave it as it isThe key to get it working is in
MainApplication.java
In the expo docs they explain you have to addnew ReactNativeHostWrapper
just skip this part and add the rest of the changes in https://github.com/expo/fyi/blob/master/expo-modules-migration.md and everything works fine! you can now use the new expo-modules.Hope this helps for others that are using
rnn-starter
and want to use expo-modules.Cool, I’m happy to help