Skip to content

Instantly share code, notes, and snippets.

@nazrdogan
Created February 11, 2019 23:03
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 nazrdogan/8f32775d01caac857acd19eaf39729d7 to your computer and use it in GitHub Desktop.
Save nazrdogan/8f32775d01caac857acd19eaf39729d7 to your computer and use it in GitHub Desktop.
import React from "react";
import { View, Text } from "react-native";
import { Button } from 'react-native-paper';
import { createStackNavigator, createAppContainer,withNavigation} from "react-navigation";
class HomeChild extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
<Button mode="contained" onPress={() => this.props.navigation.navigate("Detail") }> Child Detaya Git</Button>
</View>
);
}
}
const HomeChildWithNavigation = withNavigation(HomeChild);
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
<HomeChildWithNavigation/>
</View>
);
}
}
class DetailScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
<Text>Detail Screen</Text>
</View>
);
}
}
const AppNavigator = createStackNavigator({
Home: {
screen: HomeScreen
},
Detail: {
screen: DetailScreen
}
});
export default createAppContainer(AppNavigator);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment