Navigation is one of the most common features we will be using in mobile apps for demonstrating different screens to the user. We have 3 types of navigations in React native.
1. Stack Navigation
2. Tab Navigation
3. Drawer Navigation.
In this tutorial, we will focus mostly on How to Integrate Stack Navigation in our react native application.
Commands to Install:
npm install @react-navigation/native
npm install react-native-screens react-native-safe-area-context
Now we need to import NavigationContainer where we can place all our navigation code.
import {NavigationContainer} from '@react-navigation/native';
In App.js
<NavigationContainer>
[Your Navigation code]
</NavigationContainer>
For Stack Navigation
npm install @react-navigation/stack
npm install react-native-gesture-handler
npm install @react-native-masked-view/masked-view
Once the installation is completely done then we need to import createStackNavigator like below.
- import { createStackNavigator } from '@react-navigation/stack'
- const Stack = createStackNavigator();
- npx react-native run-android
If you like this tutorial please follow this Page.
Detailed video can be viewed on our youtube channel. Pls, subscribe to our channel for more content.
Comments
Post a Comment