(vnode: FullComponent)
| 301 | } |
| 302 | |
| 303 | export function unmountComponent (vnode: FullComponent) { |
| 304 | const component = vnode.component |
| 305 | component.hooks.forEach((hook) => { |
| 306 | if (isFunction(hook.cleanup)) { |
| 307 | hook.cleanup() |
| 308 | } |
| 309 | }) |
| 310 | if (isFunction(component.componentWillUnmount)) { |
| 311 | errorCatcher(() => { |
| 312 | (component as any).componentWillUnmount() |
| 313 | }, component) |
| 314 | } |
| 315 | component._disable = true |
| 316 | unmount(component._rendered) |
| 317 | if (!isNullOrUndef(vnode.ref)) { |
| 318 | Ref.detach(vnode, vnode.ref, vnode.dom as any) |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | function callGetDerivedStateFromProps (props, state, inst) { |
| 323 | const { getDerivedStateFromProps } = inst.constructor |
no test coverage detected