navigation in react native 1

navigation in react native


npm install @react-navigation/native --save
yarn add @react-navigation/native

### core dependencies

expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view

### stack navigation
yarn add @react-navigation/stack

Here is what the above code is Doing:
1. We’re importing the createStackNavigator function from the @react-navigation/stack package.
2. We’re importing the HomeScreen and DetailsScreen components from the ./screens folder.
3. We’re using the createStackNavigator function to create a StackNavigator object.
4. We’re passing the HomeScreen and DetailsScreen components to the StackNavigator object.
5. We’re exporting the StackNavigator object.

Similar Posts