Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bowbahdoe/7a0cc09892551d5ca193590f6729f011 to your computer and use it in GitHub Desktop.
Save bowbahdoe/7a0cc09892551d5ca193590f6729f011 to your computer and use it in GitHub Desktop.
class App extends React.Component {
constructor(props) {
this.state = {
count: 0
}
}
onClick(e) {
this.setState({
count: this.state.count + 1
});
}
render() {
return (
<div>
<h1>{this.state.count}</h1>
<button onClick={this.onClick.bind(this)}>Count Up!!</button>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment