Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-hook-form error: transformToNestObject is not a function

I want to use Material-UI radio buttons, after the react-hook-form update the validation throws the following error:

transformToNestObject is not a function

Is the Controller wrapper not correct?

Sandbox example

  <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}
  />
like image 207
vuvu Avatar asked Jul 07 '26 03:07

vuvu


1 Answers

Try upgrading @hookform/resolvers package to the latest version. Source.

like image 74
NearHuscarl Avatar answered Jul 09 '26 16:07

NearHuscarl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!