Skip to content

Instantly share code, notes, and snippets.

@dmitryshelomanov
Created February 4, 2019 20:57
Show Gist options
  • Save dmitryshelomanov/847c6896aeaf1767070f3d1ce4d46b2b to your computer and use it in GitHub Desktop.
Save dmitryshelomanov/847c6896aeaf1767070f3d1ce4d46b2b to your computer and use it in GitHub Desktop.
Stack navigator example
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