Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 26, 2020 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/a47654d4658294b660a362c4a3c6b2b0 to your computer and use it in GitHub Desktop.
Save velotiotech/a47654d4658294b660a362c4a3c6b2b0 to your computer and use it in GitHub Desktop.
export default class CounterApp extends React.Component {
constructor(props) {
super(props);
this.state = { count: 0 };
}
render() {
return (
<div className="App">
<button
onClick={() => {
this.setState({ count: this.state.count + 1 });
}}
>COUNT ({this.state.count})</button>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment