I have created a overlay and inside that overlay there's another div. I want to close the overlay when the user click on the overlay part and not do anything if the user clicks the child div. I have implemented the closing the overlay function.But the issue is it closes the overlay even if the user clicks on the child div. How can I fix this?
<div id="overlay" onClick={this.props.hideOverlay}>
<div className="ques_preview_div">
</div>
</div>
So basically the overlay should not close if the user clicks somewhere in this div.
<div className="ques_preview_div">
</div>