Created
February 26, 2017 13:26
-
-
Save brookslyrette/7321bb1d8acdf14676ef88382e5b3c5d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
| Button, | |
| StyleSheet, | |
| Text, | |
| View, | |
| } from 'react-native'; | |
| export default class Counter extends Component { | |
| render() { | |
| return ( | |
| <View> | |
| <Button | |
| title="Up" | |
| onPress={this.props.increment}/> | |
| <Text | |
| style={styles.counter} | |
| onPress={this.props.reset}> | |
| {this.props.count} | |
| </Text> | |
| <Button | |
| title="Down" | |
| onPress={this.props.decrement}/> | |
| </View> | |
| ); | |
| } | |
| } | |
| const styles = StyleSheet.create({ | |
| counter: { | |
| padding: 30, | |
| alignSelf: 'center', | |
| fontSize: 26, | |
| fontWeight: 'bold', | |
| }, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment