Created
February 4, 2019 20:57
-
-
Save dmitryshelomanov/847c6896aeaf1767070f3d1ce4d46b2b to your computer and use it in GitHub Desktop.
Stack navigator example
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, View, StyleSheet } from 'react-native'; | |
import { Constants } from 'expo'; | |
import { createStackNavigator, createAppContainer } from 'react-navigation' | |
const routes = { | |
Home: () => ( | |
<View style={styles.container}> | |
<Text style={styles.paragraph}>Home Screen</Text> | |
</View> | |
), | |
} | |
const App = createStackNavigator(routes) | |
export default createAppContainer(App) | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
paddingTop: Constants.statusBarHeight, | |
backgroundColor: '#ecf0f1', | |
padding: 8, | |
}, | |
paragraph: { | |
margin: 24, | |
fontSize: 18, | |
fontWeight: 'bold', | |
textAlign: 'center', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment