Created
May 11, 2025 13:58
-
-
Save yjsoon/a18ec6c62a72cc406f982c31d0db42f3 to your computer and use it in GitHub Desktop.
Tab Navigation template for RN with React Navigation 7
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 { Text, View } from 'react-native'; | |
import { createStaticNavigation } from '@react-navigation/native'; | |
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; | |
// Screens ------------------------------------------------- | |
const HomeScreen = () => ( | |
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> | |
<Text>Home!</Text> | |
</View> | |
); | |
const SettingsScreen = () => ( | |
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> | |
<Text>Settings!</Text> | |
</View> | |
); | |
// Navigator ----------------------------------------------- | |
const Tabs = createBottomTabNavigator({ | |
screens: { | |
Home: HomeScreen, | |
Settings: SettingsScreen, | |
}, | |
}); | |
// Root navigation component ------------------------------- | |
const Navigation = createStaticNavigation(Tabs); | |
export default function App() { | |
return <Navigation />; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment