Created
January 28, 2016 23:23
-
-
Save cacheflow/002462e6f2d283abe31b 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 App extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
clicked: false | |
} | |
} | |
doSomething() { | |
this.setState({clicked: true}) | |
console.log("state of clicked is", this.state.clicked) | |
} | |
render() { | |
return ( | |
<button onClick={this.doSomething.bind(this)}> click me </button> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment