Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(
{
variantColor,
size,
isInline,
spacing = 2,
children,
...props
}: RadioGroupProps,
ref: React.Ref,
) => {
const rootRef = React.useRef(null);
const radioGroup = useRadioGroup(props);
const clones = React.Children.map(children, (child, index) => {
if (!React.isValidElement(child)) return;
const isLastRadio = React.Children.count(children) === index + 1;
const spacingProps = isInline ? { mr: spacing } : { mb: spacing };
return (
{React.cloneElement(child, {
size,
variantColor,
name: radioGroup.name,