Skip to content

Instantly share code, notes, and snippets.

@brookslyrette
Created February 26, 2017 13:26
Show Gist options
  • Select an option

  • Save brookslyrette/7321bb1d8acdf14676ef88382e5b3c5d to your computer and use it in GitHub Desktop.

Select an option

Save brookslyrette/7321bb1d8acdf14676ef88382e5b3c5d to your computer and use it in GitHub Desktop.
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