This particular div is responsible for creating a red box. However, my goal is to remove it upon clicking. I attempted to use state to achieve this functionality but unfortunately, it did not work as expected.
import React, { Component } from "react";
class ClickMe extends Component {
render() {
return (
<div>
<h1>Click to Make Me Disappear</h1>
<h3>Go ahead, click on the box!</h3>
<div
style={{
height: "400px",
width: "400px",
background: "#ef8989",
margin: "auto",
}}
></div>
</div>
);
}
}
export default ClickMe;
);
}
}
export default ClickMe;