Installation
npm install @react-navigation/native
Installing dependencies into a bare React Native project
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
To finalize installation of react-native-gesture-handler, add the following at the top (make sure it's at the top and there's nothing else before it) of your entry file, such as index.js or App.js
import 'react-native-gesture-handler';
I recommend to read the Docs of reactnavigation , here is the link : https://reactnavigation.org/docs/getting-started