Make unrender idempotent

This commit is contained in:
fragosti
2019-03-22 15:02:12 -07:00
parent 50f5002b71
commit 6b8e40fdc9
2 changed files with 78 additions and 3 deletions

View File

@@ -73,7 +73,7 @@ export const unrender = () => {
}
ReactDOM.unmountComponentAtNode(injectedDiv);
if (parentElement) {
if (parentElement && parentElement.contains(injectedDiv)) {
parentElement.removeChild(injectedDiv);
}
};