Skip to content

Instantly share code, notes, and snippets.

@cacheflow
Created January 28, 2016 23:23
Show Gist options
  • Save cacheflow/002462e6f2d283abe31b to your computer and use it in GitHub Desktop.
Save cacheflow/002462e6f2d283abe31b to your computer and use it in GitHub Desktop.
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