class App extends Component {
constructor() {
super();
this.state = { hidden: false };
}
handleFinish = () => {
console.log("CLickedddd");
this.setState({ hidden: !this.state.hidden });
};
render() {
return (
<>
<button id="finish" onClick={this.handleFinish}>
Finish
</button>
<div
style={{ height: 300, width: 300, backgroundColor: "red" }}
className={this.state.hidden ? "hidden" : ""}
></div>
</>
);
}
}