Skip to content

Commit

Permalink
chore: clean oldInnerChild
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Oct 16, 2024
1 parent ced1ed4 commit ec2fcec
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/runtime-core/src/components/BaseTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const BaseTransitionImpl: ComponentOptions = {
!isSameVNodeType(innerChild, oldInnerChild) &&
recursiveGetSubtree(instance).type !== Comment
) {
const leavingHooks = resolveTransitionHooks(
let leavingHooks = resolveTransitionHooks(
oldInnerChild,
rawProps,
state,
Expand All @@ -228,6 +228,7 @@ const BaseTransitionImpl: ComponentOptions = {
instance.update()
}
delete leavingHooks.afterLeave
oldInnerChild = undefined
}
return emptyPlaceholder(child)
} else if (mode === 'in-out' && innerChild.type !== Comment) {
Expand All @@ -246,9 +247,16 @@ const BaseTransitionImpl: ComponentOptions = {
earlyRemove()
el[leaveCbKey] = undefined
delete enterHooks.delayedLeave
oldInnerChild = undefined
}
enterHooks.delayedLeave = () => {
delayedLeave()
delete enterHooks.delayedLeave
oldInnerChild = undefined
}
enterHooks.delayedLeave = delayedLeave
}
} else {
oldInnerChild = undefined
}
} else if (oldInnerChild) {
oldInnerChild = undefined
Expand Down

0 comments on commit ec2fcec

Please sign in to comment.