Created
June 26, 2020 11:47
-
-
Save velotiotech/ad2a21daf37372fbf03d676c5fc83a3c 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
export default class CounterApp extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { count: 0 }; | |
this.increaseCount = this.increaseCount.bind(this); | |
} | |
increaseCount() { | |
this.setState({ count: this.state.count + 1 }); | |
} | |
render() { | |
return ( | |
<div className="App"> | |
<button onClick={this.increaseCount}>COUNT ({this.state.count})</button> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment