Skip to content

Instantly share code, notes, and snippets.

@janhesters
Last active September 29, 2018 19:46
Show Gist options
  • Save janhesters/cb59531ccfdf78081ff59417dab94d5c to your computer and use it in GitHub Desktop.
Save janhesters/cb59531ccfdf78081ff59417dab94d5c to your computer and use it in GitHub Desktop.
// ... imports, remember to omit NavigationScreenProp without TypeScript
import { Button, Icon } from "react-native-elements";
import { NavigationScreenProp } from "react-navigation";
interface Props {
navigation: navigation: NavigationScreenProp<any, any>;
}
class HomeScreen extends Component<Props, object> {
// ... navigationOptions
render() {
const { navigate } = this.props.navigation;
return (
<View style={styles.container}>
<Text>This is the HomeScreen.</Text>
<Button title="Details" onPress={() => navigate("DetailScreen")} />
<Button title="Options" onPress={() => navigate("OptionsScreen")} />
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment