Last active
May 22, 2020 10:48
-
-
Save mnghn07/4436dc7bd4d4006c09ec693e30558eb3 to your computer and use it in GitHub Desktop.
This file contains 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
import React,{Component} from 'react'; | |
import {View,Text,Button} from 'react-native'; | |
export default class DetailScreen extends Component { | |
constructor(props){ | |
super(props); | |
} | |
render(){ | |
return( | |
<View style={{flex:1, justifyContent:"center", alignItems:"center"}}> | |
<Text>DetailScreen</Text> | |
<Button title="Go Back" onPress={()=> this.props.navigation.goBack()} /> | |
</View> | |
); | |
} | |
} |
This file contains 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
import React,{Component} from 'react'; | |
import {View,Text} from 'react-native'; | |
export default class HomeScreen extends Component { | |
constructor(props){ | |
super(props); | |
} | |
render(){ | |
return( | |
<View style={{flex:1, justifyContent:"center", alignItems:"center"}}> | |
<Text>HomeScreen</Text> | |
/* Use the name of the navigation in stack*/ | |
<Button title="Go to Detail" onPress={()=> this.props.navigation.navigate("Detail")} /> | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment