react-hook-form
Advanced tools
Changelog
[7.39.5] - 2022-11-21
useFormState
will trigger an extra re-render to reflect the current formState
Changelog
[7.39.0] - 2022-11-2
isValid
formState is no longer only applicable with onChange
, onTouched
, and onBlur
mode.Changelog
[7.38.0] - 2022-10-19
<input {...register("week", { min: "2022-W40" })} type="week" />
<input {...register("time", { min: "11:00" })} type="time" />
Changelog
[7.37.0] - 2022-10-07
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>
);