feat(props-util): [filterEmpty] support handle nested fragment (#5890)
parent
fa53e89e51
commit
ae451b71df
|
@ -361,8 +361,8 @@ export function filterEmpty(children = []) {
|
|||
children.forEach(child => {
|
||||
if (Array.isArray(child)) {
|
||||
res.push(...child);
|
||||
} else if (child.type === Fragment) {
|
||||
res.push(...child.children);
|
||||
} else if (child?.type === Fragment) {
|
||||
res.push(...filterEmpty(child.children));
|
||||
} else {
|
||||
res.push(child);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue