import { type UseFormReset } from "https://deno.land/x/netzo@0.5.63/deps/react-hook-form.ts";
Reset at the entire form state.
Examples
Example 1
Example 1
useEffect(() => {
// reset the entire form after component mount or form defaultValues is ready
reset({
fieldA: "test"
fieldB: "test"
});
}, [reset])
// reset by combine with existing form values
reset({
...getValues(),
fieldB: "test"
});
// reset and keep form state
reset({
...getValues(),
}, {
keepErrors: true,
keepDirty: true
});
Type Parameters
TFieldValues extends FieldValues
definition: (values?: DefaultValues<TFieldValues> | TFieldValues | ResetAction<TFieldValues>, keepStateOptions?: KeepStateOptions) => void