I've encountered a problem with my overlay setup. I have an overlay with a child div inside, and I want the overlay to close only when the user clicks on the overlay itself, not the child div. Even though I've implemented the closing function, it still closes when the user clicks on the child div. How can I resolve this issue?
<div id="overlay" onClick={this.props.hideOverlay}>
<div className="ques_preview_div">
</div>
</div>
The goal is for the overlay to remain open if the user clicks anywhere within the child div.
<div className="ques_preview_div">
</div>