From e5a80d67757efa0340455de8d89861a87bea2041 Mon Sep 17 00:00:00 2001 From: Josh Story Date: Fri, 23 Mar 2018 15:42:10 -0700 Subject: [PATCH] [fixed] portal node will be reparented if necessary on props change --- src/components/Modal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Modal.js b/src/components/Modal.js index b8246a64..34d871c0 100644 --- a/src/components/Modal.js +++ b/src/components/Modal.js @@ -134,15 +134,15 @@ class Modal extends Component { this.node.className = portalClassName; } - // Stop unnecessary renders if modal is remaining closed - if (!prevProps.isOpen && !isOpen) return; - const { prevParent, nextParent } = snapshot; if (nextParent !== prevParent) { prevParent.removeChild(this.node); nextParent.appendChild(this.node); } + // Stop unnecessary renders if modal is remaining closed + if (!prevProps.isOpen && !isOpen) return; + !isReact16 && this.renderPortal(this.props); }