Skip to content

Commit

Permalink
fix(runtime-core): prevent unmounted vnode from being inserted
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Feb 12, 2025
1 parent 263f63f commit 2440b2f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,13 @@ function baseCreateRenderer(
queuePostRenderEffect(() => transition!.enter(el!), parentSuspense)
} else {
const { leave, delayLeave, afterLeave } = transition!
const remove = () => hostInsert(el!, container, anchor)
const remove = () => {
if (vnode.ctx!.isUnmounted) {
hostRemove(el!)
} else {
hostInsert(el!, container, anchor)
}
}
const performLeave = () => {
leave(el!, () => {
remove()
Expand Down

0 comments on commit 2440b2f

Please sign in to comment.