Skip to content

Commit

Permalink
fix(templateRef): delay setting the ref value if wrapped in Suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Sep 30, 2024
1 parent 29de6f8 commit 58cf236
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/runtime-core/src/rendererTemplateRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export function setRef(
vnode: VNode,
isUnmount = false,
): void {
if (parentSuspense) {
queuePostRenderEffect(() => {
setRef(rawRef, oldRawRef, null, vnode, isUnmount)
}, parentSuspense)
return
}

if (isArray(rawRef)) {
rawRef.forEach((r, i) =>
setRef(
Expand Down

0 comments on commit 58cf236

Please sign in to comment.