Last active
August 22, 2022 16:46
-
-
Save rahgurung/95821e9bbc0f576e24e063d3103a76bc to your computer and use it in GitHub Desktop.
This file contains 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 * as React from 'react'; | |
import {Text} from 'react-native'; | |
import {NavigationContainer} from '@react-navigation/native'; | |
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; | |
// Our Tabs | |
function Tab1() { | |
return <Text>Tab 1</Text>; | |
} | |
function Tab2() { | |
return <Text>Tab 2</Text>; | |
} | |
// Initialize the Tab navigator | |
const Tab = createBottomTabNavigator(); | |
// We always surround navigator with NavigationContainer | |
function TabsNavigation() { | |
return ( | |
<NavigationContainer> | |
<Tab.Navigator> | |
<Tab.Screen name="Tab1" component={Tab1} /> | |
<Tab.Screen name="Tab2" component={Tab2} /> | |
</Tab.Navigator> | |
</NavigationContainer> | |
); | |
} | |
export default TabsNavigation; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment