Created
November 17, 2017 05:42
-
-
Save barongun/3e294dad4c2e4776ced503b6f4a5a741 to your computer and use it in GitHub Desktop.
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 { View, Text, Button } from 'react-native'; | |
import { StackNavigator } from 'react-navigation'; | |
const HomeScreen = ({navigation}) => ( | |
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> | |
<Text>Home Screen</Text> | |
<Button | |
onPress={() => navigation.navigate('Details')} | |
title="Go to details" | |
/> | |
</View> | |
); | |
const DetailsScreen = () => ( | |
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> | |
<Text>Details Screen</Text> | |
</View> | |
); | |
const RootNavigator = StackNavigator({ | |
Home: { | |
screen: HomeScreen, | |
navigationOptions: { | |
headerTitle: 'Home', | |
}, | |
}, | |
Details: { | |
screen: DetailsScreen, | |
navigationOptions: { | |
headerTitle: 'Details', | |
}, | |
}, | |
}); | |
export default RootNavigator; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment