diff --git a/src/preact-portal.js b/src/preact-portal.js index 2d46583..d4f29fe 100644 --- a/src/preact-portal.js +++ b/src/preact-portal.js @@ -22,9 +22,10 @@ export default class Portal extends Component { } componentWillUnmount() { + if (this.remote && !this.remote.parentNode) return; this.renderLayer(false); this.isMounted=false; - if (this.remote && this.remote.parentNode) this.remote.parentNode.removeChild(this.remote); + this.remote.parentNode.removeChild(this.remote); } findNode(node) {