diff --git a/src/checkbox/CheckboxGroup.tsx b/src/checkbox/CheckboxGroup.tsx index 54577b1b8f..4c27bccee0 100644 --- a/src/checkbox/CheckboxGroup.tsx +++ b/src/checkbox/CheckboxGroup.tsx @@ -52,7 +52,10 @@ 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: JSX.Element) => child.type.displayName === Checkbox.displayName && (child as ReactElement).props, + ) || []; const optionsWithoutCheckAll = intervalOptions.filter((t) => typeof t !== 'object' || !t.checkAll); const optionsWithoutCheckAllValues = [];