Skip to content

Instantly share code, notes, and snippets.

@ernestofreyreg
Created June 29, 2017 14:18
Show Gist options
  • Save ernestofreyreg/83aaf4e51d7a47b8a92ba5976012cccd to your computer and use it in GitHub Desktop.
Save ernestofreyreg/83aaf4e51d7a47b8a92ba5976012cccd to your computer and use it in GitHub Desktop.
class Counter extends React.Component {
state = {
count: 0
}
increase = () => {
this.setState({count: this.state.count + 1})
}
render () {
return <button onClick={this.increase}>{count}</button>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment