Skip to content

Instantly share code, notes, and snippets.

@cacheflow
Last active January 29, 2016 00:12
Show Gist options
  • Save cacheflow/163f07e544d5a91f8ece to your computer and use it in GitHub Desktop.
Save cacheflow/163f07e544d5a91f8ece to your computer and use it in GitHub Desktop.
class App extends MainComponent {
constructor() {
super();
this.state = {
clicked: false
}
this._bind('doSomething')
}
doSomething() {
this.setState({clicked: true});
console.log("state of clicked is", this.state.clicked)
}
render() {
return (
<div>
<button onClick={this.doSomething}> click me </button>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment