feat(props-util): [filterEmpty] support handle nested fragment (#5890)

pull/5901/head
bqy_fe 2022-08-14 09:04:17 +08:00 committed by GitHub
parent fa53e89e51
commit ae451b71df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -361,8 +361,8 @@ export function filterEmpty(children = []) {
children.forEach(child => { children.forEach(child => {
if (Array.isArray(child)) { if (Array.isArray(child)) {
res.push(...child); res.push(...child);
} else if (child.type === Fragment) { } else if (child?.type === Fragment) {
res.push(...child.children); res.push(...filterEmpty(child.children));
} else { } else {
res.push(child); res.push(child);
} }