Link to the demo: https://codesandbox.io/s/material-demo-9fwlz
While it seems like this code should have checkable radio elements, it does not. Any thoughts on what is broken? This is derived from the material-ui demo snippet, and the only modification is that the radio elements within the RadioGroup are dynamically generated from input props.
export default function RadioButtonsGroup(props) {
const [value, setValue] = React.useState(null);
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setValue((event.target as HTMLInputElement).value);
};
return (
<FormControl component="fieldset">
<FormLabel component="legend">Gender</FormLabel>
<RadioGroup
aria-label="gender"
name="gender1"
value={value}
onChange={handleChange}
>
{props.options.map(([value, readable], index) => (
<FormControlLabel
key={index}
value={value}
control={<Radio />}
label={readable}
/>
))}
</RadioGroup>
</FormControl>
);
}