Created
September 30, 2021 23:56
-
-
Save ssdev-95/d508627ab41b29b65d2358572b2eea45 to your computer and use it in GitHub Desktop.
Stack Navigation example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'react-native-gesture-handler'; | |
| import React from 'react'; | |
| import {MainScreen} from './MainScreen'; | |
| import {SecondScreen} from './ComponentB'; | |
| import {NavigationContainer} from '@react-navigation/native'; | |
| import {createStackNavigator} from '@react-navigation/stack'; | |
| const Stack = createStackNavigator(); | |
| class App extends React.Component { | |
| render() { | |
| return ( | |
| <NavigationContainer> | |
| <Stack.Navigator initialRouteName="Home"> | |
| <Stack.Screen | |
| name="Home" | |
| component={MainScreen} | |
| options={{headerShown: false}} | |
| /> | |
| <Stack.Screen | |
| name="Second" | |
| component={SecondScreen} | |
| options={{headerShown: false}} | |
| /> | |
| </Stack.Navigator> | |
| </NavigationContainer> | |
| ); | |
| } | |
| } | |
| export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment