Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

fieldapioptions.md

157 lines4.0 KB

Interface: FieldApiOptions<TParentData, TName, TFieldValidator, TFormValidator, TData>

An object type representing the required options for the FieldApi class.

Extends

  • FieldOptions<TParentData, TName, TFieldValidator, TFormValidator, TData>

Type parameters

• TParentData

• TName extends DeepKeys<TParentData>

• TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined

• TFormValidator extends Validator<TParentData, unknown> | undefined = undefined

• TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>

Properties

asyncAlways?

optional asyncAlways: boolean;

If true, always run async validation, even if there are errors emitted during synchronous validation.

Inherited from

FieldOptions.asyncAlways

Source

packages/form-core/src/FieldApi.ts:283


asyncDebounceMs?

optional asyncDebounceMs: number;

The default time to debounce async validation if there is not a more specific debounce time passed.

Inherited from

FieldOptions.asyncDebounceMs

Source

packages/form-core/src/FieldApi.ts:279


defaultMeta?

optional defaultMeta: Partial<FieldMeta>;

An optional object with default metadata for the field.

Inherited from

FieldOptions.defaultMeta

Source

packages/form-core/src/FieldApi.ts:301


defaultValue?

optional defaultValue: NoInfer<TData>;

An optional default value for the field.

Inherited from

FieldOptions.defaultValue

Source

packages/form-core/src/FieldApi.ts:275


form

form: FormApi<TParentData, TFormValidator>;

Source

packages/form-core/src/FieldApi.ts:324


name

name: TName;

The field name. The type will be DeepKeys<TParentData> to ensure your name is a deep key of the parent dataset.

Inherited from

FieldOptions.name

Source

packages/form-core/src/FieldApi.ts:271


validatorAdapter?

optional validatorAdapter: TFieldValidator;

A validator provided by an extension, like yupValidator from @tanstack/yup-form-adapter

Inherited from

FieldOptions.validatorAdapter

Source

packages/form-core/src/FieldApi.ts:287


validators?

optional validators: FieldValidators<TParentData, TName, TFieldValidator, TFormValidator, TData>;

A list of validators to pass to the field

Inherited from

FieldOptions.validators

Source

packages/form-core/src/FieldApi.ts:291