I\'m trying to create a modal in React JS
I have one outter div which is the whole body and I have I inner div. I want to apply the function to close the modal if it
Attach a function to the inner div which stops propagation.
function stopPropagation(e) {
e.stopPropagation();
}
In your case <div style={this.popupInnerDivStyle()} onClick={stopPropagation}>
Does this help you: ReactJS SyntheticEvent stopPropagation() only works with React events?
You could use JS Event.stopPropagation to prevent event from bubbling to the parent if inner element is clicked.