Skip to content

Commit

Permalink
fix(utils): getRootNodes flattens only one depth of children (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
cexbrayat committed Jun 2, 2022
1 parent 3bf3376 commit cbf90ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/getRootNodes.ts
Expand Up @@ -25,9 +25,9 @@ export function getRootNodes(vnode: VNode): Node[] {
}
return result
} else if (vnode.shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
const children = (vnode.children as unknown as VNodeArrayChildren).flat(
Infinity
) as VNode[]
const children = (
vnode.children as unknown as VNodeArrayChildren
).flat() as VNode[]

return children
.flatMap((vnode) => getRootNodes(vnode))
Expand Down

0 comments on commit cbf90ae

Please sign in to comment.