Skip to content

Instantly share code, notes, and snippets.

@LeoLeBras
Last active September 15, 2016 09:06
Show Gist options
  • Save LeoLeBras/0ad3db6dd614e17973ed to your computer and use it in GitHub Desktop.
Save LeoLeBras/0ad3db6dd614e17973ed to your computer and use it in GitHub Desktop.
class Sample extends Component{
state = { value: 0 };
_onClick(){
this.setState({
value: value + 1
});
}
render(){
return(
<div>
<span>{ this.state.value }</span>
<span onClick={ this._onClick.bind(this) }>+</span>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment