Skip to content

Instantly share code, notes, and snippets.

@aloukissas aloukissas/App-2.js
Created Jan 7, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.