diff --git a/components/_util/props-util/index.js b/components/_util/props-util/index.js index 49d54cd24..d67820cd9 100644 --- a/components/_util/props-util/index.js +++ b/components/_util/props-util/index.js @@ -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); }