Skip to content

Instantly share code, notes, and snippets.

@androidfanatic
Created March 23, 2020 07:10
Show Gist options
  • Save androidfanatic/5a91555c11378a79a8cad097f081bcb7 to your computer and use it in GitHub Desktop.
Save androidfanatic/5a91555c11378a79a8cad097f081bcb7 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