I'm trying to pass a class only to the checked radio button in my component, but with my existing code all the radio buttons receive the class. Any advice?
export default function RadioGroup({options}){
const [isChecked, setIsChecked] = useState(false);
return(
<>
{options.map(option => {
return (
<Radio
radioID={option.id}
radioName={name}
radioLabel={option.label}
radioClass={` ${isChecked ? "bg-blue" : ""}`}
onChange={() => setIsChecked((prev) => !prev)}
/>
)
})}
</>
);
}