Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const { bum, effects, update, subTree, um, da, isDeactivated } = instance
// beforeUnmount hook
if (bum !== null) {
invokeHooks(bum)
}
if (effects !== null) {
for (let i = 0; i < effects.length; i++) {
stop(effects[i])
}
}
// update may be null if a component is unmounted before its async
// setup has resolved.
if (update !== null) {
stop(update)
unmount(subTree, instance, parentSuspense, doRemove)
}
// unmounted hook
if (um !== null) {
queuePostRenderEffect(um, parentSuspense)
}
// deactivated hook
if (
da !== null &&
!isDeactivated &&
instance.vnode.shapeFlag & ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE
) {
queuePostRenderEffect(da, parentSuspense)
}
queuePostFlushCb(() => {
instance.isUnmounted = true
instance: ComponentInternalInstance,
parentSuspense: HostSuspenseBoundary | null,
doRemove?: boolean
) {
if (__HMR__ && instance.type.__hmrId != null) {
unregisterHMR(instance)
}
const { bum, effects, update, subTree, um, da, isDeactivated } = instance
// beforeUnmount hook
if (bum !== null) {
invokeHooks(bum)
}
if (effects !== null) {
for (let i = 0; i < effects.length; i++) {
stop(effects[i])
}
}
// update may be null if a component is unmounted before its async
// setup has resolved.
if (update !== null) {
stop(update)
unmount(subTree, instance, parentSuspense, doRemove)
}
// unmounted hook
if (um !== null) {
queuePostRenderEffect(um, parentSuspense)
}
// deactivated hook
if (
da !== null &&
!isDeactivated &&
return () => {
stop(runner)
}
}