Skip to content

Instantly share code, notes, and snippets.

@treyhuffine
Created October 13, 2017 00:40
Show Gist options
  • Save treyhuffine/e6877a12b3da2c62116d78816b680eaf to your computer and use it in GitHub Desktop.
Save treyhuffine/e6877a12b3da2c62116d78816b680eaf to your computer and use it in GitHub Desktop.
class Clicker extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
this.state = {
clicks: 0
};
}
handleClick() {
this.setState({
clicks: this.state.clicks + 1
});
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment