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

FormValidationPredicateContext.md

105 lines2.1 KB

1---
2id: FormValidationPredicateContext
3title: FormValidationPredicateContext
4---
5​
6Defined in: [validation.public.ts:419](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L419)
7​
8Current form state available to validator conditions and delay callbacks.
9​
10## Extends
11​
12- `BaseValidationPredicateContext`\<`TFormData`, `TFormData`, `"form"`\>
13​
14## Type Parameters
15​
16### TFormData
17​
18`TFormData`
19​
20Library-managed. Do not specify explicitly.
21​
22## Properties
23​
24### fieldApi?
25​
26```ts
27optional fieldApi?: AnyFieldApi;
28```
29​
30Defined in: [validation.public.ts:409](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L409)
31​
32The field associated with the validation event, when available.
33​
34For form and group validators, this is the field that triggered the
35validation. For field validators, this is the field being validated.
36​
37#### Inherited from
38​
39```ts
40BaseValidationPredicateContext.fieldApi
41```
42​
43***
44​
45### formApi
46​
47```ts
48formApi: FormApi<TFormData, any>;
49```
50​
51Defined in: [validation.public.ts:402](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L402)
52​
53The owning form, including its complete values and state.
54​
55#### Inherited from
56​
57```ts
58BaseValidationPredicateContext.formApi
59```
60​
61***
62​
63### groupApi?
64​
65```ts
66optional groupApi?: undefined;
67```
68​
69Defined in: [validation.public.ts:422](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L422)
70​
71***
72​
73### scope
74​
75```ts
76scope: "form";
77```
78​
79Defined in: [validation.public.ts:400](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L400)
80​
81Identifies whether `value` belongs to a form, form group, or field.
82​
83#### Inherited from
84​
85```ts
86BaseValidationPredicateContext.scope
87```
88​
89***
90​
91### value
92​
93```ts
94value: TFormData;
95```
96​
97Defined in: [validation.public.ts:411](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L411)
98​
99The current value in this validator's scope when the callback is evaluated.
100​
101#### Inherited from
102​
103```ts
104BaseValidationPredicateContext.value
105```