Skip to content

Instantly share code, notes, and snippets.

@rahgurung
Last active August 22, 2022 16:46
Show Gist options
  • Save rahgurung/95821e9bbc0f576e24e063d3103a76bc to your computer and use it in GitHub Desktop.
Save rahgurung/95821e9bbc0f576e24e063d3103a76bc 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 {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