Skip to content

Instantly share code, notes, and snippets.

@aloukissas
Created January 7, 2019 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aloukissas/b98a78f2a383708c8dcdf95b7b1cdf66 to your computer and use it in GitHub Desktop.
Save aloukissas/b98a78f2a383708c8dcdf95b7b1cdf66 to your computer and use it in GitHub Desktop.
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