Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

UseFormHandleSubmit

Validate the entire form. Handle submit and error callback.

@example
const onSubmit = (data) => console.log(data);
const onError = (error) => console.log(error);

<form onSubmit={handleSubmit(onSubmit, onError)} />
type UseFormHandleSubmit<TFieldValues extends FieldValues, TTransformedValues extends FieldValues | undefined = undefined> = (onValid: TTransformedValues extends FieldValues ? SubmitHandler<TTransformedValues> : SubmitHandler<TFieldValues>, onInvalid?: SubmitErrorHandler<TFieldValues>) => (e?: React.BaseSyntheticEvent) => Promise<void>;

§Type Parameters

§
TFieldValues extends FieldValues
[src]
§
TTransformedValues extends FieldValues | undefined = undefined
[src]

§Type

§
(onValid: TTransformedValues extends FieldValues ? SubmitHandler<TTransformedValues> : SubmitHandler<TFieldValues>, onInvalid?: SubmitErrorHandler<TFieldValues>) => (e?: React.BaseSyntheticEvent) => Promise<void>
[src]