1### ISNTALATION
2
3npm install @react-navigation/native --save
4yarn add @react-navigation/native
5
6### core dependencies
7
8expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
9
10### stack navigation
11yarn add @react-navigation/stack
1npm install --save react-navigation
2expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
3npm install --save react-navigation-stack
4import { createAppContainer } from 'react-navigation';
5import { createStackNavigator } from 'react-navigation-stack';
1## Yarn
2yarn add @react-navigation/native
3yarn add react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
4
5## Npm
6npm install @react-navigation/native
7npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
8
9## Expo
10expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
1import * as React from 'react';
2import { NavigationContainer } from '@react-navigation/native';
3import { createStackNavigator } from '@react-navigation/stack';
4
5const Stack = createStackNavigator();
6
7const MyStack = () => {
8 return (
9 <NavigationContainer>
10 <Stack.Navigator>
11 <Stack.Screen
12 name="Home"
13 component={HomeScreen}
14 options={{ title: 'Welcome' }}
15 />
16 <Stack.Screen name="Profile" component={ProfileScreen} />
17 </Stack.Navigator>
18 </NavigationContainer>
19 );
20};
21
1npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
2