AutorÃa | Ultima modificación | Ver Log |
import React from 'react';
import { FormControlLabel, Radio } from '@mui/material';
import { Controller, useFormContext } from 'react-hook-form';
export function FormRadioButton({ name, label, ...props }) {
const { control } = useFormContext();
return (
<Controller
name={name}
control={control}
render={({ field }) => (
<FormControlLabel control={<Radio {...field} {...props} />} label={label} />
)}
/>
);
}