React-navigation 3 update the App container

There are some new changes with new react-navigation which is the main navigation system used in React Native app. The significant change which may affect your app is the app container. The app container is responsible for managing app state and linking the top-level navigator to the app environment.


import { createAppContainer } from 'react-navigation';
// you can also import from @react-navigation/native

const AppNavigator = createStackNavigator(...);

const AppContainer = createAppContainer(AppNavigator);

The AppContainer now becomes the main component loaded in the App.js without any wrapping view.

Posted by justinpham

Leave a Reply