Created
December 27, 2018 16:10
-
-
Save gisderdube/6c086b36ce3bba1a621993650a7cbce2 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 Counter extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { count: 0 } | |
} | |
render() { | |
return( | |
<div> | |
<h1>{this.state.count}</h1> | |
<button onClick={this._increaseCount}>Increase Count</button> | |
</div> | |
) | |
} | |
_increaseCount = () => { | |
this.setState({ count: this.state.count + 1 }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment