react-hook-form
Advanced tools
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 mutationChangelog
[7.45.0] - 2023-06-20
onChange
- onChange: (...event: any[]) => void;
+ onChange: (event: ChangeEvent | FieldPathValue<TFieldValues, TName>) => void;
useFormContext
- export const useFormContext: <TFieldValues extends FieldValues, TransformedValues extends FieldValues | undefined = undefined>() => UseFormReturn<TFieldValues>;
+ export const useFormContext: <TFieldValues extends FieldValues, TContext = any, TransformedValues extends FieldValues | undefined = undefined>() => UseFormReturn<TFieldValues, TContext, TransformedValues>;