Installing and Configuring React Navigation
Install React Navigation and its dependencies, wrap the app in a NavigationContainer, and set up your first stack navigator with two screens.
What is React Navigation?
React Navigation is the most popular library for handling navigation in React Native apps. It provides a set of navigators — Stack, Tab, Drawer — that let you move between screens, pass data, and manage navigation history. React Navigation is JavaScript-based and works seamlessly with Expo and bare React Native projects.
Installing Core Dependencies
React Navigation requires its core package plus a set of native dependencies. Run the install command and then install the native stack and required gesture/animation libraries.
npm install @react-navigation/native
npx expo install react-native-screens react-native-safe-area-contextAll lessons in this course
- Installing and Configuring React Navigation
- Navigating Between Screens and Passing Params
- Bottom Tab Navigator
- Drawer Navigator and Nested Navigators