refactor(runtime-core): remove the deactivated branch in unmountComponent method (#2012)

This commit is contained in:
zhangzhonghe
2020-09-02 09:03:50 +08:00
committed by GitHub
parent 691a4b9530
commit 0d0970f9cd
2 changed files with 42 additions and 32 deletions

View File

@@ -2096,7 +2096,7 @@ function baseCreateRenderer(
unregisterHMR(instance)
}
const { bum, effects, update, subTree, um, da, isDeactivated } = instance
const { bum, effects, update, subTree, um } = instance
// beforeUnmount hook
if (bum) {
invokeArrayFns(bum)
@@ -2116,14 +2116,6 @@ function baseCreateRenderer(
if (um) {
queuePostRenderEffect(um, parentSuspense)
}
// deactivated hook
if (
da &&
!isDeactivated &&
instance.vnode.shapeFlag & ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE
) {
queuePostRenderEffect(da, parentSuspense)
}
queuePostRenderEffect(() => {
instance.isUnmounted = true
}, parentSuspense)