@@ -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:859 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L859 )
10
+ Defined in: [ packages/form-core/src/FieldApi.ts:864 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L864 )
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:973 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L973 )
68
+ Defined in: [ packages/form-core/src/FieldApi.ts:978 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L978 )
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:889 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L889 )
90
+ Defined in: [ packages/form-core/src/FieldApi.ts:894 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L894 )
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 : unknown extends TParentData ? string : TParentData extends readonly any [] & IsTuple < TParentData > ? PrefixTupleAccessor < TParentData < TParentData > , AllowedIndexes < TParentData < TParentData > , never > , []> : TParentData extends any [] ? PrefixArrayAccessor < TParentData < TParentData > , [any ]> : TParentData extends Date ? never : TParentData extends object ? PrefixObjectAccessor < TParentData < TParentData > , []> : TParentData extends string | number | bigint | boolean ? " " : never ;
100
100
```
101
101
102
- Defined in: [ packages/form-core/src/FieldApi.ts:913 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L913 )
102
+ Defined in: [ packages/form-core/src/FieldApi.ts:918 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L918 )
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:917 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L917 )
114
+ Defined in: [ packages/form-core/src/FieldApi.ts:922 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L922 )
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:941 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L941 )
126
+ Defined in: [ packages/form-core/src/FieldApi.ts:946 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L946 )
127
127
128
128
The field state store.
129
129
@@ -135,7 +135,7 @@ The field state store.
135
135
timeoutIds : Record < ValidationCause , null | Timeout > ;
136
136
```
137
137
138
- Defined in: [ packages/form-core/src/FieldApi.ts:968 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L968 )
138
+ Defined in: [ packages/form-core/src/FieldApi.ts:973 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L973 )
139
139
140
140
## Accessors
141
141
@@ -147,7 +147,7 @@ Defined in: [packages/form-core/src/FieldApi.ts:968](https://github.com/TanStack
147
147
get state (): FieldState < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync >
148
148
```
149
149
150
- Defined in: [ packages/form-core/src/FieldApi.ts:965 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L965 )
150
+ Defined in: [ packages/form-core/src/FieldApi.ts:970 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L970 )
151
151
152
152
The current field state.
153
153
@@ -163,7 +163,7 @@ The current field state.
163
163
getInfo (): FieldInfo < TParentData >
164
164
```
165
165
166
- Defined in: [ packages/form-core/src/FieldApi.ts:1221 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1221 )
166
+ Defined in: [ packages/form-core/src/FieldApi.ts:1220 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1220 )
167
167
168
168
Gets the field information object.
169
169
@@ -179,7 +179,7 @@ Gets the field information object.
179
179
getMeta (): FieldMeta < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync >
180
180
```
181
181
182
- Defined in: [ packages/form-core/src/FieldApi.ts:1189 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1189 )
182
+ Defined in: [ packages/form-core/src/FieldApi.ts:1188 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1188 )
183
183
184
184
#### Returns
185
185
@@ -193,7 +193,7 @@ Defined in: [packages/form-core/src/FieldApi.ts:1189](https://github.com/TanStac
193
193
getValue (): TData
194
194
```
195
195
196
- Defined in: [ packages/form-core/src/FieldApi.ts:1171 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1171 )
196
+ Defined in: [ packages/form-core/src/FieldApi.ts:1170 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1170 )
197
197
198
198
Gets the current field value.
199
199
@@ -213,7 +213,7 @@ Use `field.state.value` instead.
213
213
handleBlur (): void
214
214
```
215
215
216
- Defined in: [ packages/form-core/src/FieldApi.ts:1632 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1632 )
216
+ Defined in: [ packages/form-core/src/FieldApi.ts:1631 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1631 )
217
217
218
218
Handles the blur event.
219
219
@@ -229,7 +229,7 @@ Handles the blur event.
229
229
handleChange (updater ): void
230
230
```
231
231
232
- Defined in: [ packages/form-core/src/FieldApi.ts:1625 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1625 )
232
+ Defined in: [ packages/form-core/src/FieldApi.ts:1624 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1624 )
233
233
234
234
Handles the change event.
235
235
@@ -254,7 +254,7 @@ insertValue(
254
254
opts ? ): void
255
255
` ` `
256
256
257
- Defined in: [packages/form-core/src/FieldApi.ts:1241 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1241 )
257
+ Defined in: [packages/form-core/src/FieldApi.ts:1240 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1240 )
258
258
259
259
Inserts a value at the specified index, shifting the subsequent values to the right.
260
260
@@ -284,7 +284,7 @@ Inserts a value at the specified index, shifting the subsequent values to the ri
284
284
mount (): () => void
285
285
` ` `
286
286
287
- Defined in: [packages/form-core/src/FieldApi.ts:1077 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1077 )
287
+ Defined in: [packages/form-core/src/FieldApi.ts:1076 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1076 )
288
288
289
289
Mounts the field instance to the form.
290
290
@@ -307,7 +307,7 @@ moveValue(
307
307
opts ? ): void
308
308
` ` `
309
309
310
- Defined in: [packages/form-core/src/FieldApi.ts:1297 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1297 )
310
+ Defined in: [packages/form-core/src/FieldApi.ts:1296 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1296 )
311
311
312
312
Moves the value at the first specified index to the second specified index.
313
313
@@ -337,7 +337,7 @@ Moves the value at the first specified index to the second specified index.
337
337
pushValue (value , opts ? ): void
338
338
` ` `
339
339
340
- Defined in: [packages/form-core/src/FieldApi.ts:1226 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1226 )
340
+ Defined in: [packages/form-core/src/FieldApi.ts:1225 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1225 )
341
341
342
342
Pushes a new value to the field.
343
343
@@ -363,7 +363,7 @@ Pushes a new value to the field.
363
363
removeValue (index , opts ? ): void
364
364
` ` `
365
365
366
- Defined in: [packages/form-core/src/FieldApi.ts:1273 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1273 )
366
+ Defined in: [packages/form-core/src/FieldApi.ts:1272 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1272 )
367
367
368
368
Removes a value at the specified index.
369
369
@@ -392,7 +392,7 @@ replaceValue(
392
392
opts ? ): void
393
393
` ` `
394
394
395
- Defined in: [packages/form-core/src/FieldApi.ts:1257 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1257 )
395
+ Defined in: [packages/form-core/src/FieldApi.ts:1256 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1256 )
396
396
397
397
Replaces a value at the specified index.
398
398
@@ -422,7 +422,7 @@ Replaces a value at the specified index.
422
422
setErrorMap (errorMap ): void
423
423
` ` `
424
424
425
- Defined in: [packages/form-core/src/FieldApi.ts:1652 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1652 )
425
+ Defined in: [packages/form-core/src/FieldApi.ts:1651 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1651 )
426
426
427
427
Updates the field's errorMap
428
428
@@ -444,7 +444,7 @@ Updates the field's errorMap
444
444
setMeta (updater ): void
445
445
` ` `
446
446
447
- Defined in: [packages/form-core/src/FieldApi.ts:1194 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1194 )
447
+ Defined in: [packages/form-core/src/FieldApi.ts:1193 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1193 )
448
448
449
449
Sets the field metadata.
450
450
@@ -466,7 +466,7 @@ Sets the field metadata.
466
466
setValue (updater , options ? ): void
467
467
` ` `
468
468
469
- Defined in: [packages/form-core/src/FieldApi.ts:1178 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1178 )
469
+ Defined in: [packages/form-core/src/FieldApi.ts:1177 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1177 )
470
470
471
471
Sets the field value and run the ` change ` validator.
472
472
@@ -495,7 +495,7 @@ swapValues(
495
495
opts ? ): void
496
496
` ` `
497
497
498
- Defined in: [packages/form-core/src/FieldApi.ts:1285 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1285 )
498
+ Defined in: [packages/form-core/src/FieldApi.ts:1284 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1284 )
499
499
500
500
Swaps the values at the specified indices.
501
501
@@ -525,7 +525,7 @@ Swaps the values at the specified indices.
525
525
update (opts ): void
526
526
` ` `
527
527
528
- Defined in: [packages/form-core/src/FieldApi.ts:1119 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1119 )
528
+ Defined in: [packages/form-core/src/FieldApi.ts:1118 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1118 )
529
529
530
530
Updates the field instance with new options.
531
531
@@ -547,7 +547,7 @@ Updates the field instance with new options.
547
547
validate (cause , opts ? ): unknown [] | Promise < unknown []>
548
548
` ` `
549
549
550
- Defined in: [packages/form-core/src/FieldApi.ts:1592 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1592 )
550
+ Defined in: [packages/form-core/src/FieldApi.ts:1591 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1591 )
551
551
552
552
Validates the field value.
553
553
0 commit comments