Skip to content

Commit 02e78f5

Browse files
fix(h): fix rendering error when children is a function
1 parent 8998afa commit 02e78f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/runtime-core/src/vnode.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,10 @@ export function normalizeChildren(vnode: VNode, children: unknown) {
800800
}
801801
}
802802
} else if (isFunction(children)) {
803+
if (shapeFlag & ShapeFlags.ELEMENT) {
804+
normalizeChildren(vnode, children())
805+
return
806+
}
803807
children = { default: children, _ctx: currentRenderingInstance }
804808
type = ShapeFlags.SLOTS_CHILDREN
805809
} else {

0 commit comments

Comments
 (0)