()
| 169 | } |
| 170 | |
| 171 | componentWillUnmount() { |
| 172 | if (!canUseDOM || !this.node || !this.portal) return; |
| 173 | |
| 174 | const state = this.portal.state; |
| 175 | const now = Date.now(); |
| 176 | const closesAt = |
| 177 | state.isOpen && |
| 178 | this.props.closeTimeoutMS && |
| 179 | (state.closesAt || now + this.props.closeTimeoutMS); |
| 180 | |
| 181 | if (closesAt) { |
| 182 | if (!state.beforeClose) { |
| 183 | this.portal.closeWithTimeout(); |
| 184 | } |
| 185 | |
| 186 | setTimeout(this.removePortal, closesAt - now); |
| 187 | } else { |
| 188 | this.removePortal(); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | removePortal = () => { |
| 193 | !isReact16 && ReactDOM.unmountComponentAtNode(this.node); |
nothing calls this directly
no outgoing calls
no test coverage detected