Skip to content

useFormHandler

useFormHandler<T>(form, event, handler): void

Defined in: hooks.ts:80

Add a submission handler to the form with automatic cleanup

T extends object

Form<T>

Form instance

"willSubmit"

Submission phase of the handler (willSubmit, submit or didSubmit)

(abortSignal: AbortSignal) => Promise<boolean>

Handler to add

void

No memoization of the handler is needed as it is stored in a ref internally.

useFormHandler<T>(form, event, handler): void

Defined in: hooks.ts:85

Add a submission handler to the form with automatic cleanup

T extends object

Form<T>

Form instance

"submit"

Submission phase of the handler (willSubmit, submit or didSubmit)

(abortSignal: AbortSignal) => Promise<boolean>

Handler to add

void

No memoization of the handler is needed as it is stored in a ref internally.

useFormHandler<T>(form, event, handler): void

Defined in: hooks.ts:90

Add a submission handler to the form with automatic cleanup

T extends object

Form<T>

Form instance

"didSubmit"

Submission phase of the handler (willSubmit, submit or didSubmit)

(succeed: boolean) => void

Handler to add

void

No memoization of the handler is needed as it is stored in a ref internally.