(prevProps, _, snapshot)
| 149 | } |
| 150 | |
| 151 | componentDidUpdate(prevProps, _, snapshot) { |
| 152 | if (!canUseDOM) return; |
| 153 | const { isOpen, portalClassName } = this.props; |
| 154 | |
| 155 | if (prevProps.portalClassName !== portalClassName) { |
| 156 | this.node.className = portalClassName; |
| 157 | } |
| 158 | |
| 159 | const { prevParent, nextParent } = snapshot; |
| 160 | if (nextParent !== prevParent) { |
| 161 | prevParent.removeChild(this.node); |
| 162 | nextParent.appendChild(this.node); |
| 163 | } |
| 164 | |
| 165 | // Stop unnecessary renders if modal is remaining closed |
| 166 | if (!prevProps.isOpen && !isOpen) return; |
| 167 | |
| 168 | !isReact16 && this.renderPortal(this.props); |
| 169 | } |
| 170 | |
| 171 | componentWillUnmount() { |
| 172 | if (!canUseDOM || !this.node || !this.portal) return; |
nothing calls this directly
no outgoing calls
no test coverage detected