Summary:
This issue comes up when I run react testing library tests. It seems that the parent component removes react-modal I am assuming on unmount event what leads to Error: Uncaught [NotFoundError: The node to be removed is not a child of this node.]. . This issue is very similar to already raised one #769 but the corresponding PR #778 does not actually address the original issue.
I found code which causes this issue
|
const parent = getParentElement(this.props.parentSelector); |
|
if (parent) { |
|
parent.removeChild(this.node); |
|
} else { |
and fix should pretty simple like
if (parent && parent.contains(this.node)) {
parent.removeChild(this.node);
}
I will appreciate if someone comes up with a workaround.