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

Validator.md

147 lines3.0 KB

Defined in: validation.public.ts:24

Extends

Extended by

Type Parameters

TFormData

TFormData

TValidator

TValidator extends | StandardSchemaV1 | ValidatorFn<any, any>

TContextValue

TContextValue

TTrigger

TTrigger extends ValidatorTrigger = ValidatorTrigger

TScope

TScope extends ValidatorScope = ValidatorScope

Properties

bailIfInvalid?

optional bailIfInvalid?: boolean;

Defined in: validation.public.ts:21

If true, this validator and all subsequent validators will be skipped if any previous validator has failed. If false, validators run regardless of earlier validation results.

Default

false

Inherited from

BaseValidator.bailIfInvalid


run

run: TValidator;

Defined in: validation.public.ts:14

Inherited from

BaseValidator.run


runOnMount?

optional runOnMount?: boolean;

Defined in: validation.public.ts:45

Whether this validator should be called once when the form is constructed.

Default

false

runOnSubmit?

optional runOnSubmit?: 
  | boolean
| ValidationPredicateFn<TFormData, TContextValue, TScope>;

Defined in: validation.public.ts:38

TODO docs

Whether this validator should be called during a submission attempt.

Default

true

triggerDebounceMs?

optional triggerDebounceMs?: 
  | number
| ValidationDebounceFn<TFormData, TContextValue, TScope>;

Defined in: validation.public.ts:52

The debounce time in milliseconds for validation triggers (change, blur). Does not affect submit events, which always execute immediately.

Default

0

triggers

triggers: ValidationTriggerOption<TFormData, TContextValue, TTrigger, TScope>[];

Defined in: validation.public.ts:54