Skip to content

Commit ae451b7

Browse files
authored
feat(props-util): [filterEmpty] support handle nested fragment (#5890)
1 parent fa53e89 commit ae451b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/_util/props-util/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ export function filterEmpty(children = []) {
361361
children.forEach(child => {
362362
if (Array.isArray(child)) {
363363
res.push(...child);
364-
} else if (child.type === Fragment) {
365-
res.push(...child.children);
364+
} else if (child?.type === Fragment) {
365+
res.push(...filterEmpty(child.children));
366366
} else {
367367
res.push(child);
368368
}

0 commit comments

Comments
 (0)