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 HomeScreen 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>
);
}
}
class DetailScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Details Screen</Text>
<Button
onPress={() => this.props.navigation.push('Detail')}>{"Tekrar Detail'e git"}</Button>
<Button
onPress={() => this.props.navigation.navigate('Detail')}>{"Detail'e git"}</Button>
<Button
onPress={() => this.props.navigation.navigate('Home')}>{"Home'a git"}</Button>
<Button
onPress={() => this.props.navigation.goBack()}>{"Geri git"}</Button>
</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.