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

BaseValidator.md

55 lines1.2 KB

1---
2id: BaseValidator
3title: BaseValidator
4---
5​
6Defined in: [validation.public.ts:17](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L17)
7​
8A validation function or Standard Schema with an optional rule to stop after earlier failures.
9​
10## Extended by
11​
12- [`Validator`](Validator.md)
13- [`FormValidator`](FormValidator.md)
14​
15## Type Parameters
16​
17### TValidator
18​
19`TValidator` *extends*
20 \| [`StandardSchemaV1`](../type-aliases/StandardSchemaV1.md)
21 \| [`ValidatorFn`](../type-aliases/ValidatorFn.md)\<`any`, `any`\>
22​
23Library-managed. Do not specify explicitly.
24​
25## Properties
26​
27### bailIfInvalid?
28​
29```ts
30optional bailIfInvalid?: boolean;
31```
32​
33Defined in: [validation.public.ts:29](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L29)
34​
35If `true`, skips this and subsequent validators when earlier validation has failed.
36​
37If `false`, earlier failures do not prevent this validator from running.
38​
39#### Default
40​
41```ts
42false
43```
44​
45***
46​
47### run
48​
49```ts
50run: TValidator;
51```
52​
53Defined in: [validation.public.ts:21](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L21)
54​
55The function or Standard Schema that validates the value in this validator's scope.