Skip to content

Instantly share code, notes, and snippets.

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