{ Children.map(checkboxItemsArray, (child: any, index) => {
if (isValidElement(child) && (child.type === CheckboxItem)) {
const checkboxItemId = child?.props?.id ? child?.props?.id : idPrefix;
return (
<>
{
cloneElement(child as React.ReactElement
, {
id: index > 0 ? `${checkboxItemId}-${index}` : checkboxItemId,
data: value,
name: name
})
}
>
);
}
})}