Last active
September 15, 2016 09:06
-
-
Save LeoLeBras/0ad3db6dd614e17973ed to your computer and use it in GitHub Desktop.
This file contains 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 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