The bubbling processing

event.target === event.currentTarget

const handleClick = (event) = > {
    // Close the modal box when clicking on the mask itself, do not close the modal box when clicking on the content of the modal box
    if (event.target === event.currentTarget) {
       // 
    }
}
  
<div className="comp-modal-one" onClick={handleClick}>
    
</div>
Copy the code