我想使用 Material-UI 单选按钮,在 react-hook-form
更新后,验证会引发以下错误:
transformToNestObject is not a function
Controller
包装器不正确吗?
<Controller
render={({ field, fieldState }) => (
<RadioGroup {...field} aria-label="option">
<FormControlLabel
value="A"
control={<Radio size="small" color="primary" />}
label="A"
/>
<FormControlLabel
value="B"
control={<Radio size="small" color="primary" />}
label="B"
/>
</RadioGroup>
)}
name="option"
control={control}
/>