-
-
Save amandeepmittal/04828abfa4bd12ceff146ee7b74528a5 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
// ScreenThree.js | |
import React, { Component } from 'react'; | |
import { StyleSheet, View, Text, TouchableHighlight } from 'react-native'; | |
class ScreenThree extends Component { | |
static navigationOptions = ({ navigation }) => ({ | |
title: `Welcome ${navigation.state.params.screen}` | |
}); | |
render() { | |
const { params } = this.props.navigation.state; | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.titleText}>{params.screen}</Text> | |
<TouchableHighlight | |
style={styles.button} | |
onPress={() => this.props.navigation.goBack()} | |
> | |
<Text style={styles.buttonText}>Go Back</Text> | |
</TouchableHighlight> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center' | |
}, | |
titleText: { | |
fontSize: 22 | |
}, | |
button: { | |
alignSelf: 'stretch', | |
marginRight: 25, | |
marginLeft: 25, | |
marginTop: 20, | |
borderRadius: 20, | |
backgroundColor: '#ff0044', | |
height: 50, | |
justifyContent: 'center' | |
}, | |
buttonText: { | |
color: 'white', | |
fontSize: 18, | |
alignSelf: 'center' | |
} | |
}); | |
export default ScreenThree; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment