An object representing the options for a form.
• TFormData
• TFormValidator extends Validator
<TFormData
, unknown
> | undefined
= undefined
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:154
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:158
optional defaultState: Partial<FormState<TFormData>>;
The default state for the form.
packages/form-core/src/FormApi.ts:150
optional defaultValues: TFormData;
Set initial values for your form.
packages/form-core/src/FormApi.ts:146
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>
• props
• props.formApi: FormApi
<TFormData
, TFormValidator
>
• props.value: TFormData
any
packages/form-core/src/FormApi.ts:170
optional onSubmitInvalid: (props) => void;
Specify an action for scenarios where the user tries to submit an invalid form.
• props
• props.formApi: FormApi
<TFormData
, TFormValidator
>
• props.value: TFormData
void
packages/form-core/src/FormApi.ts:177
optional transform: FormTransform<TFormData, TFormValidator>;
packages/form-core/src/FormApi.ts:181
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:162
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.