diff --git a/packages/form/src/layouts/LightFilter/index.tsx b/packages/form/src/layouts/LightFilter/index.tsx index 6d7456b0eb66..a7a89b8b0330 100644 --- a/packages/form/src/layouts/LightFilter/index.tsx +++ b/packages/form/src/layouts/LightFilter/index.tsx @@ -280,7 +280,7 @@ function LightFilter>(props: LightFilterProps) { return ( { + items={items?.flatMap((item: any) => { /** 如果是 ProFormGroup,直接拼接dom */ if (item?.type.displayName === 'ProForm-Group') return item.props.children; diff --git a/packages/form/src/layouts/QueryFilter/index.tsx b/packages/form/src/layouts/QueryFilter/index.tsx index b7baf4e873c2..a7e8aa55aebb 100644 --- a/packages/form/src/layouts/QueryFilter/index.tsx +++ b/packages/form/src/layouts/QueryFilter/index.tsx @@ -191,7 +191,7 @@ const flatMapItems = ( items: React.ReactNode[], ignoreRules?: boolean, ): React.ReactNode[] => { - return items.flatMap((item: any) => { + return items?.flatMap((item: any) => { if (item?.type.displayName === 'ProForm-Group' && !item.props?.title) { return item.props.children; }