Skip to content
Form Listener API Reference

FormListenerFn

ts
type FormListenerFn<TFormData, TFormErrorTypes> = (context) => void;

Defined in: listeners.public.ts:238

A callback invoked when a form listener runs.

The return value is ignored. A returned promise is not awaited, and a rejected promise is reported to the console.

Type Parameters

TFormData

TFormData

Library-managed. Do not specify explicitly.

TFormErrorTypes

TFormErrorTypes extends FormErrorTypes

Library-managed. Do not specify explicitly.

Parameters

context

FormListenerContext<TFormData, TFormErrorTypes>

Returns

void

Example

ts
run: ({ value }) => {
  saveDraft(value)
},