Created
February 4, 2019 12:19
-
-
Save Ribeiro-Tiago/b47e20dce761670a55244799de7c0a27 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
interface Props { | |
navigation: NavigationScreenProp<any, any>; | |
} | |
class Home extends React.Component<Props> { | |
render() { | |
return ( | |
<View style={{ flex: 1, justifyContent: "space-around", alignItems: "center" }}> | |
<Text style={{ fontSize: 48, fontWeight: "bold" }}>Home Screen</Text> | |
<Button title="Profile" onPress={() => this.props.navigation.navigate("Profile")} /> | |
<Button title="Settings" onPress={() => this.props.navigation.navigate("Settings")} /> | |
</View> | |
) | |
} | |
} | |
class Profile extends React.Component<Props> { | |
render() { | |
return ( | |
<View style={{ flex: 1, justifyContent: "space-around", alignItems: "center" }}> | |
<Text style={{ fontSize: 48, fontWeight: "bold" }}>Profile Screen</Text> | |
<Button title="Home" onPress={() => this.props.navigation.navigate("Home")} /> | |
<Button title="Settings" onPress={() => this.props.navigation.navigate("Settings")} /> | |
</View> | |
) | |
} | |
} | |
class Settings extends React.Component<Props> { | |
render() { | |
return ( | |
<View style={{ flex: 1, justifyContent: "space-around", alignItems: "center" }}> | |
<Text style={{ fontSize: 48, fontWeight: "bold" }}>Settings Screen</Text> | |
<Button title="Home" onPress={() => this.props.navigation.navigate("Home")} /> | |
<Button title="Profile" onPress={() => this.props.navigation.navigate("Profile")} /> | |
</View> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment