From ac9f285b26f29dc09e28488c420d42b533c73893 Mon Sep 17 00:00:00 2001 From: huangchen1031 Date: Mon, 2 Dec 2024 16:29:58 +0800 Subject: [PATCH] fix(CheckboxGroup): robustness --- src/checkbox/CheckboxGroup.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/checkbox/CheckboxGroup.tsx b/src/checkbox/CheckboxGroup.tsx index 399d5e6ee6..54577b1b8f 100644 --- a/src/checkbox/CheckboxGroup.tsx +++ b/src/checkbox/CheckboxGroup.tsx @@ -52,7 +52,7 @@ const CheckboxGroup = (props: const intervalOptions = Array.isArray(options) && options.length > 0 ? options - : React.Children.map(children, (child) => (child as ReactElement).props) || []; + : React.Children.map(children, (child) => (child as ReactElement)?.props || {}) || []; const optionsWithoutCheckAll = intervalOptions.filter((t) => typeof t !== 'object' || !t.checkAll); const optionsWithoutCheckAllValues = [];