Home:ALL Converter>React native: start application after adding react-native-navigation

React native: start application after adding react-native-navigation

Ask Time:2019-06-03T18:31:18         Author:ste

Json Formatter

I have a very simple react native application that I'm running on the Android emulator.

Now I have a problem: I can't run the app anymore after adding the package react-native-navigation (https://wix.github.io/react-native-navigation).

I followed the instructions here: https://wix.github.io/react-native-navigation/#/docs/Installing and after the setup I run the command npm run android as specified in the installation guide. The build runs fine:

BUILD SUCCESSFUL in 3s
63 actionable tasks: 1 executed, 62 up-to-date

The script run the build in my terminal but doesn't start the application in the emulator. In the emulator I can see my app listed in the settings -> app menu but I can't access it since I can find any button for accessing the menu with all the apps.

On the contrary if I run the command I used to use before installing the navigation package (react-native run-android) the app runs in the emulator but according to the documentation:

When your app is launched for the first time, the bundle is parsed and executed. At this point you need to show your UI. To do so, Listen to the appLaunched event and call Navigation.setRoot when the event is received.

I shouldn't be able to see my UI directly without first registering the screens, so it's like my app is running but without the navigation.

What is the correct way to proceed? If the documentation says to use npm run android how should I start my app after that?

Author:ste,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/56425486/react-native-start-application-after-adding-react-native-navigation
yy