@@ -7,7 +7,7 @@ title: FieldApi
7
7
8
8
# Class: FieldApi\< TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TParentSubmitMeta\>
9
9
10
- Defined in: [ packages/form-core/src/FieldApi.ts:842 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L842 )
10
+ Defined in: [ packages/form-core/src/FieldApi.ts:845 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L845 )
11
11
12
12
A class representing the API for managing a form field.
13
13
@@ -65,7 +65,7 @@ the `new FieldApi` constructor.
65
65
new FieldApi <TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync , TFormOnServer , TParentSubmitMeta >(opts ): FieldApi < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync , TFormOnServer , TParentSubmitMeta >
66
66
```
67
67
68
- Defined in: [ packages/form-core/src/FieldApi.ts:970 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L970 )
68
+ Defined in: [ packages/form-core/src/FieldApi.ts:976 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L976 )
69
69
70
70
Initializes a new ` FieldApi ` instance.
71
71
@@ -87,7 +87,7 @@ Initializes a new `FieldApi` instance.
87
87
form : FormApi < TParentData , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync , TFormOnServer , TParentSubmitMeta > ;
88
88
```
89
89
90
- Defined in: [ packages/form-core/src/FieldApi.ts:886 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L886 )
90
+ Defined in: [ packages/form-core/src/FieldApi.ts:889 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L889 )
91
91
92
92
A reference to the form API instance.
93
93
@@ -99,7 +99,7 @@ A reference to the form API instance.
99
99
name : DeepKeys < TParentData > ;
100
100
```
101
101
102
- Defined in: [ packages/form-core/src/FieldApi.ts:910 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L910 )
102
+ Defined in: [ packages/form-core/src/FieldApi.ts:913 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L913 )
103
103
104
104
The field name.
105
105
@@ -111,7 +111,7 @@ The field name.
111
111
options : FieldApiOptions < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync , TFormOnServer , TParentSubmitMeta > ;
112
112
```
113
113
114
- Defined in: [ packages/form-core/src/FieldApi.ts:914 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L914 )
114
+ Defined in: [ packages/form-core/src/FieldApi.ts:917 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L917 )
115
115
116
116
The field options.
117
117
@@ -123,7 +123,7 @@ The field options.
123
123
store : Derived < FieldState < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync >> ;
124
124
```
125
125
126
- Defined in: [ packages/form-core/src/FieldApi.ts:938 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L938 )
126
+ Defined in: [ packages/form-core/src/FieldApi.ts:941 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L941 )
127
127
128
128
The field state store.
129
129
@@ -132,10 +132,22 @@ The field state store.
132
132
### timeoutIds
133
133
134
134
``` ts
135
- timeoutIds : Record < ValidationCause , null | Timeout > ;
135
+ timeoutIds : object ;
136
136
```
137
137
138
- Defined in: [ packages/form-core/src/FieldApi.ts:965] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L965 )
138
+ Defined in: [ packages/form-core/src/FieldApi.ts:968] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L968 )
139
+
140
+ #### listeners
141
+
142
+ ``` ts
143
+ listeners : Record < ListenerCause , null | Timeout > ;
144
+ ```
145
+
146
+ #### validations
147
+
148
+ ``` ts
149
+ validations : Record < ValidationCause , null | Timeout > ;
150
+ ```
139
151
140
152
## Accessors
141
153
@@ -147,7 +159,7 @@ Defined in: [packages/form-core/src/FieldApi.ts:965](https://github.com/TanStack
147
159
get state (): FieldState < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync >
148
160
```
149
161
150
- Defined in: [ packages/form-core/src/FieldApi.ts:962 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L962 )
162
+ Defined in: [ packages/form-core/src/FieldApi.ts:965 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L965 )
151
163
152
164
The current field state.
153
165
@@ -163,7 +175,7 @@ The current field state.
163
175
getInfo (): FieldInfo < TParentData >
164
176
```
165
177
166
- Defined in: [ packages/form-core/src/FieldApi.ts:1218 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1218 )
178
+ Defined in: [ packages/form-core/src/FieldApi.ts:1224 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1224 )
167
179
168
180
Gets the field information object.
169
181
@@ -179,7 +191,7 @@ Gets the field information object.
179
191
getMeta (): FieldMeta < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync >
180
192
```
181
193
182
- Defined in: [ packages/form-core/src/FieldApi.ts:1186 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1186 )
194
+ Defined in: [ packages/form-core/src/FieldApi.ts:1192 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1192 )
183
195
184
196
#### Returns
185
197
@@ -193,7 +205,7 @@ Defined in: [packages/form-core/src/FieldApi.ts:1186](https://github.com/TanStac
193
205
getValue (): TData
194
206
```
195
207
196
- Defined in: [ packages/form-core/src/FieldApi.ts:1168 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1168 )
208
+ Defined in: [ packages/form-core/src/FieldApi.ts:1177 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1177 )
197
209
198
210
Gets the current field value.
199
211
@@ -213,7 +225,7 @@ Use `field.state.value` instead.
213
225
handleBlur (): void
214
226
```
215
227
216
- Defined in: [ packages/form-core/src/FieldApi.ts:1625 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1625 )
228
+ Defined in: [ packages/form-core/src/FieldApi.ts:1616 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1616 )
217
229
218
230
Handles the blur event.
219
231
@@ -229,7 +241,7 @@ Handles the blur event.
229
241
handleChange (updater ): void
230
242
```
231
243
232
- Defined in: [ packages/form-core/src/FieldApi.ts:1618 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1618 )
244
+ Defined in: [ packages/form-core/src/FieldApi.ts:1609 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1609 )
233
245
234
246
Handles the change event.
235
247
@@ -254,7 +266,7 @@ insertValue(
254
266
opts ? ): void
255
267
` ` `
256
268
257
- Defined in: [packages/form-core/src/FieldApi.ts:1238 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1238 )
269
+ Defined in: [packages/form-core/src/FieldApi.ts:1241 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1241 )
258
270
259
271
Inserts a value at the specified index, shifting the subsequent values to the right.
260
272
@@ -284,7 +296,7 @@ Inserts a value at the specified index, shifting the subsequent values to the ri
284
296
mount (): () => void
285
297
` ` `
286
298
287
- Defined in: [packages/form-core/src/FieldApi.ts:1063 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1063 )
299
+ Defined in: [packages/form-core/src/FieldApi.ts:1072 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1072 )
288
300
289
301
Mounts the field instance to the form.
290
302
@@ -307,7 +319,7 @@ moveValue(
307
319
opts ? ): void
308
320
` ` `
309
321
310
- Defined in: [packages/form-core/src/FieldApi.ts:1294 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1294 )
322
+ Defined in: [packages/form-core/src/FieldApi.ts:1285 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1285 )
311
323
312
324
Moves the value at the first specified index to the second specified index.
313
325
@@ -337,7 +349,7 @@ Moves the value at the first specified index to the second specified index.
337
349
pushValue (value , opts ? ): void
338
350
` ` `
339
351
340
- Defined in: [packages/form-core/src/FieldApi.ts:1223 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1223 )
352
+ Defined in: [packages/form-core/src/FieldApi.ts:1229 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1229 )
341
353
342
354
Pushes a new value to the field.
343
355
@@ -363,7 +375,7 @@ Pushes a new value to the field.
363
375
removeValue (index , opts ? ): void
364
376
` ` `
365
377
366
- Defined in: [packages/form-core/src/FieldApi.ts:1270 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1270 )
378
+ Defined in: [packages/form-core/src/FieldApi.ts:1267 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1267 )
367
379
368
380
Removes a value at the specified index.
369
381
@@ -422,7 +434,7 @@ Replaces a value at the specified index.
422
434
setErrorMap (errorMap ): void
423
435
` ` `
424
436
425
- Defined in: [packages/form-core/src/FieldApi.ts:1645 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1645 )
437
+ Defined in: [packages/form-core/src/FieldApi.ts:1633 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1633 )
426
438
427
439
Updates the field's errorMap
428
440
@@ -444,7 +456,7 @@ Updates the field's errorMap
444
456
setMeta (updater ): void
445
457
` ` `
446
458
447
- Defined in: [packages/form-core/src/FieldApi.ts:1191 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1191 )
459
+ Defined in: [packages/form-core/src/FieldApi.ts:1197 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1197 )
448
460
449
461
Sets the field metadata.
450
462
@@ -466,7 +478,7 @@ Sets the field metadata.
466
478
setValue (updater , options ? ): void
467
479
` ` `
468
480
469
- Defined in: [packages/form-core/src/FieldApi.ts:1175 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1175 )
481
+ Defined in: [packages/form-core/src/FieldApi.ts:1184 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1184 )
470
482
471
483
Sets the field value and run the ` change ` validator.
472
484
@@ -495,7 +507,7 @@ swapValues(
495
507
opts ? ): void
496
508
` ` `
497
509
498
- Defined in: [packages/form-core/src/FieldApi.ts:1282 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1282 )
510
+ Defined in: [packages/form-core/src/FieldApi.ts:1276 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1276 )
499
511
500
512
Swaps the values at the specified indices.
501
513
@@ -525,7 +537,7 @@ Swaps the values at the specified indices.
525
537
update (opts ): void
526
538
` ` `
527
539
528
- Defined in: [packages/form-core/src/FieldApi.ts:1111 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1111 )
540
+ Defined in: [packages/form-core/src/FieldApi.ts:1120 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1120 )
529
541
530
542
Updates the field instance with new options.
531
543
@@ -547,7 +559,7 @@ Updates the field instance with new options.
547
559
validate (cause , opts ? ): unknown [] | Promise < unknown []>
548
560
` ` `
549
561
550
- Defined in: [packages/form-core/src/FieldApi.ts:1585 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1585 )
562
+ Defined in: [packages/form-core/src/FieldApi.ts:1576 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1576 )
551
563
552
564
Validates the field value.
553
565
0 commit comments