react-hook-form
Advanced tools
Changelog
[7.48.0] - 2023-11-05
disabled
prop for useForm
to disable the entire formconst App = () => {
const [disabled, setDisabled] = useState(false);
const { handleSubmit } = useForm({ disabled });
return (
<form
onSubmit={handleSubmit(async () => {
setDisabled(true);
await sleep(100);
setDisabled(false);
})}
/ >
);
}
Changelog
[7.47.0] - 2023-10-02
reset
api with keepIsSubmitSuccessful
option, keep successfully submitted form state.<Form
onSubmit={() => {
reset(formValues, {
keepIsSubmitSuccessful: true,
});
}}
/>
Changelog
[7.46.0] - 2023-09-03
disabled
propconst [disabled, setDisabled] = useState(false);
useController({
disabled,
});
exact
option for array name in useWatch
isDirty
when setting disabled
in register
reset
argument mutation