Created
May 28, 2018 15:23
-
-
Save kyo504/9ec2c67f5fc35d5095b1aa21206b0c02 to your computer and use it in GitHub Desktop.
deep-navigation-options
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 from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { StackNavigator, TabNavigator } from 'react-navigation'; | |
class HomeScreen extends React.Component { | |
static navigationOptions = { tabBarLabel: 'Home!' }; | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>HomeScreen</Text> | |
</View> | |
) | |
} | |
} | |
class SettingsScreen extends React.Component { | |
static navigationOptions = { tabBarLabel: 'Settings!' }; | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>SettingsScreen</Text> | |
</View> | |
) | |
} | |
} | |
const HomeStack = StackNavigator({ Home: HomeScreen }); | |
const SettingsStack = StackNavigator({ Settings: SettingsScreen }); | |
const AppNavigator = TabNavigator({ HomeStack, SettingsStack }); | |
export default class App extends Component { | |
render() { | |
return <AppNavigator />; | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment