Skip to content

Commit 69304cf

Browse files
committed
refactor: adjust logic branches
1 parent 7562e72 commit 69304cf

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/runtime-core/src/renderer.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,14 @@ export const setRef = (
316316
if (!vnode) {
317317
// means unmount
318318
value = null
319-
} else {
319+
} else if (isAsyncWrapper(vnode)) {
320320
// when mounting async components, nothing needs to be done,
321321
// because the template ref is forwarded to inner component
322-
if (isAsyncWrapper(vnode)) return
323-
if (vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
324-
value = vnode.component!.exposed || vnode.component!.proxy
325-
} else {
326-
value = vnode.el
327-
}
322+
return
323+
} else if (vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
324+
value = vnode.component!.exposed || vnode.component!.proxy
325+
} else {
326+
value = vnode.el
328327
}
329328

330329
const { i: owner, r: ref } = rawRef

0 commit comments

Comments
 (0)