Skip to content

Instantly share code, notes, and snippets.

@rahgurung
Last active August 13, 2022 17:39
Show Gist options
  • Save rahgurung/554f2addf699d0eb78acbcba965af3ab to your computer and use it in GitHub Desktop.
Save rahgurung/554f2addf699d0eb78acbcba965af3ab to your computer and use it in GitHub Desktop.
import * as React from 'react';
import {Text} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
// Our Screens
function Screen1() {
return <Text>Screen 1</Text>;
}
function Screen2() {
return <Text>Screen 2</Text>;
}
// Initialize the Stack navigator
const Stack = createNativeStackNavigator();
function StackNavigation() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Screen1" component={Screen1} />
<Stack.Screen name="Screen2" component={Screen2} />
</Stack.Navigator>
</NavigationContainer>
);
}
export default StackNavigation;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment