Created
October 13, 2017 00:40
-
-
Save treyhuffine/e6877a12b3da2c62116d78816b680eaf 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
| 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