Skip to content

react-hook-form 7.37.0

[7.37.0] - 2022-10-07

Added

  • new formState defaultValues
const { formState, watch } = useForm({
  defaultValues: { name: 'test' },
});
const { defaultValues } = useFormState();

const name = watch('name');

return (
  <div>
    <p>Your name was {defaultValues.name}</p>
    <p>Updated name is {name}</p>
  </div>
);

Changed

  • defaultValues: complex object data contains prototype methods will not be cloned internally