Skip to content

Instantly share code, notes, and snippets.

@ddc22
Created June 16, 2019 11:55
Show Gist options
  • Save ddc22/cf9f497b0fcf21ddd4300df5958d2047 to your computer and use it in GitHub Desktop.
Save ddc22/cf9f497b0fcf21ddd4300df5958d2047 to your computer and use it in GitHub Desktop.
import React from "react";
class StorePlay extends React.Component {
state = {
count : 0,
};
componentDidMount() {
}
render() {
return (
<div>
<button onClick={() => this.setState({ count : this.state.count+1})}>
INCREMENT
</button>
<button onClick={() => this.setState({ count : this.state.count-1})}>
DECREMENT
</button>
<h2>Count</h2>
<div>{this.state.count}</div>
</div>
);
}
}
export default StorePlay;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment