An object representing the options for a form.
• TFormData
• TFormValidator extends Validator<TFormData, unknown> | undefined = undefined
optional asyncAlways: boolean;
optional asyncAlways: boolean;
If true, always run async validation, even when sync validation has produced an error. Defaults to undefined.
packages/form-core/src/FormApi.ts:163
optional asyncDebounceMs: number;
optional asyncDebounceMs: number;
Optional time in milliseconds if you want to introduce a delay before firing off an async action.
packages/form-core/src/FormApi.ts:167
optional defaultState: Partial<FormState<TFormData>>;
optional defaultState: Partial<FormState<TFormData>>;
The default state for the form.
packages/form-core/src/FormApi.ts:159
optional defaultValues: TFormData;
optional defaultValues: TFormData;
Set initial values for your form.
packages/form-core/src/FormApi.ts:155
optional onSubmit: (props) => any;
optional onSubmit: (props) => any;
A function to be called when the form is submitted, what should happen once the user submits a valid form returns any or a promise Promise<any>
FormApi<TFormData, TFormValidator>
TFormData
any
packages/form-core/src/FormApi.ts:179
optional onSubmitInvalid: (props) => void;
optional onSubmitInvalid: (props) => void;
Specify an action for scenarios where the user tries to submit an invalid form.
FormApi<TFormData, TFormValidator>
TFormData
void
packages/form-core/src/FormApi.ts:186
optional transform: FormTransform<TFormData, TFormValidator>;
optional transform: FormTransform<TFormData, TFormValidator>;
packages/form-core/src/FormApi.ts:190
optional validatorAdapter: TFormValidator;
optional validatorAdapter: TFormValidator;
A validator adapter to support usage of extra validation types (IE: Zod, Yup, or Valibot usage)
packages/form-core/src/FormApi.ts:171
optional validators: FormValidators<TFormData, TFormValidator>;
optional validators: FormValidators<TFormData, TFormValidator>;
A list of validators to pass to the form
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.