import { type UseFormHandleSubmit } from "https://deno.land/x/netzo@0.4.72/deps/react-hook-form.ts";
Validate the entire form. Handle submit and error callback.
Examples
Example 1
Example 1
const onSubmit = (data) => console.log(data);
const onError = (error) => console.log(error);
<form onSubmit={handleSubmit(onSubmit, onError)} />
Type Parameters
TFieldValues extends FieldValues
optional
TTransformedValues extends FieldValues | undefined = undefineddefinition: (onValid: TTransformedValues extends FieldValues ? SubmitHandler<TTransformedValues> : SubmitHandler<TFieldValues>, onInvalid?: SubmitErrorHandler<TFieldValues>) => (e?: React.BaseSyntheticEvent) => Promise<void>