Created
January 7, 2019 21:34
-
-
Save aloukissas/b98a78f2a383708c8dcdf95b7b1cdf66 to your computer and use it in GitHub Desktop.
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 React from "react"; | |
import { Button, StyleSheet, Text, View } from "react-native"; | |
import { createStackNavigator, createAppContainer } from "react-navigation"; | |
class CitiesScreen extends React.Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>Cities Screen</Text> | |
<Button | |
title="Go to Lists" | |
onPress={() => this.props.navigation.navigate("Lists")} | |
/> | |
</View> | |
); | |
} | |
} | |
class ListsScreen extends React.Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>Lists Screen</Text> | |
<Button | |
title="Go to Entries" | |
onPress={() => this.props.navigation.navigate("Entries")} | |
/> | |
</View> | |
); | |
} | |
} | |
class EntriesScreen extends React.Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>Entries Screen</Text> | |
</View> | |
); | |
} | |
} | |
const AppNavigator = createStackNavigator({ | |
Cities: { | |
screen: CitiesScreen | |
}, | |
Lists: { | |
screen: ListsScreen | |
}, | |
Entries: { | |
screen: EntriesScreen | |
} | |
}); | |
export default createAppContainer(AppNavigator); | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: "#fff", | |
alignItems: "center", | |
justifyContent: "center" | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment