@@ -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:855 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L855 )
10
+ Defined in: [ packages/form-core/src/FieldApi.ts:859 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L859 )
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:987 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L987 )
68
+ Defined in: [ packages/form-core/src/FieldApi.ts:991 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L991 )
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:899 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L899 )
90
+ Defined in: [ packages/form-core/src/FieldApi.ts:903 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L903 )
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:923 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L923 )
102
+ Defined in: [ packages/form-core/src/FieldApi.ts:927 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L927 )
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:927 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L927 )
114
+ Defined in: [ packages/form-core/src/FieldApi.ts:931 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L931 )
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:951 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L951 )
126
+ Defined in: [ packages/form-core/src/FieldApi.ts:955 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L955 )
127
127
128
128
The field state store.
129
129
@@ -135,7 +135,7 @@ The field state store.
135
135
timeoutIds : object ;
136
136
```
137
137
138
- Defined in: [ packages/form-core/src/FieldApi.ts:978 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L978 )
138
+ Defined in: [ packages/form-core/src/FieldApi.ts:982 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L982 )
139
139
140
140
#### formListeners
141
141
@@ -165,7 +165,7 @@ validations: Record<ValidationCause, null | Timeout>;
165
165
get state (): FieldState < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync >
166
166
```
167
167
168
- Defined in: [ packages/form-core/src/FieldApi.ts:975 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L975 )
168
+ Defined in: [ packages/form-core/src/FieldApi.ts:979 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L979 )
169
169
170
170
The current field state.
171
171
@@ -181,7 +181,7 @@ The current field state.
181
181
getInfo (): FieldInfo < TParentData >
182
182
```
183
183
184
- Defined in: [ packages/form-core/src/FieldApi.ts:1241 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1241 )
184
+ Defined in: [ packages/form-core/src/FieldApi.ts:1245 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1245 )
185
185
186
186
Gets the field information object.
187
187
@@ -197,7 +197,7 @@ Gets the field information object.
197
197
getMeta (): FieldMeta < TParentData , TName , TData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TFormOnMount , TFormOnChange , TFormOnChangeAsync , TFormOnBlur , TFormOnBlurAsync , TFormOnSubmit , TFormOnSubmitAsync >
198
198
```
199
199
200
- Defined in: [ packages/form-core/src/FieldApi.ts:1209 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1209 )
200
+ Defined in: [ packages/form-core/src/FieldApi.ts:1213 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1213 )
201
201
202
202
#### Returns
203
203
@@ -211,7 +211,7 @@ Defined in: [packages/form-core/src/FieldApi.ts:1209](https://github.com/TanStac
211
211
getValue (): TData
212
212
```
213
213
214
- Defined in: [ packages/form-core/src/FieldApi.ts:1194 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1194 )
214
+ Defined in: [ packages/form-core/src/FieldApi.ts:1198 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1198 )
215
215
216
216
Gets the current field value.
217
217
@@ -231,7 +231,7 @@ Use `field.state.value` instead.
231
231
handleBlur (): void
232
232
```
233
233
234
- Defined in: [ packages/form-core/src/FieldApi.ts:1653 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1653 )
234
+ Defined in: [ packages/form-core/src/FieldApi.ts:1657 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1657 )
235
235
236
236
Handles the blur event.
237
237
@@ -247,7 +247,7 @@ Handles the blur event.
247
247
handleChange (updater ): void
248
248
```
249
249
250
- Defined in: [ packages/form-core/src/FieldApi.ts:1646 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1646 )
250
+ Defined in: [ packages/form-core/src/FieldApi.ts:1650 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1650 )
251
251
252
252
Handles the change event.
253
253
@@ -272,7 +272,7 @@ insertValue(
272
272
opts ? ): void
273
273
` ` `
274
274
275
- Defined in: [packages/form-core/src/FieldApi.ts:1258 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1258 )
275
+ Defined in: [packages/form-core/src/FieldApi.ts:1262 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1262 )
276
276
277
277
Inserts a value at the specified index, shifting the subsequent values to the right.
278
278
@@ -302,7 +302,7 @@ Inserts a value at the specified index, shifting the subsequent values to the ri
302
302
mount (): () => void
303
303
` ` `
304
304
305
- Defined in: [packages/form-core/src/FieldApi.ts:1084 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1084 )
305
+ Defined in: [packages/form-core/src/FieldApi.ts:1088 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1088 )
306
306
307
307
Mounts the field instance to the form.
308
308
@@ -325,7 +325,7 @@ moveValue(
325
325
opts ? ): void
326
326
` ` `
327
327
328
- Defined in: [packages/form-core/src/FieldApi.ts:1302 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1302 )
328
+ Defined in: [packages/form-core/src/FieldApi.ts:1306 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1306 )
329
329
330
330
Moves the value at the first specified index to the second specified index.
331
331
@@ -357,7 +357,7 @@ parseValueWithSchema(schema):
357
357
| StandardSchemaV1Issue []
358
358
` ` `
359
359
360
- Defined in: [packages/form-core/src/FieldApi.ts:1688 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1688 )
360
+ Defined in: [packages/form-core/src/FieldApi.ts:1692 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1692 )
361
361
362
362
Parses the field's value with the given schema and returns
363
363
issues (if any). This method does NOT set any internal errors.
@@ -385,7 +385,7 @@ parseValueWithSchemaAsync(schema): Promise<
385
385
| StandardSchemaV1Issue []>
386
386
` ` `
387
387
388
- Defined in: [packages/form-core/src/FieldApi.ts:1700 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1700 )
388
+ Defined in: [packages/form-core/src/FieldApi.ts:1704 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1704 )
389
389
390
390
Parses the field's value with the given schema and returns
391
391
issues (if any). This method does NOT set any internal errors.
@@ -412,7 +412,7 @@ The standard schema to parse this field's value with.
412
412
pushValue (value , opts ? ): void
413
413
` ` `
414
414
415
- Defined in: [packages/form-core/src/FieldApi.ts:1246 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1246 )
415
+ Defined in: [packages/form-core/src/FieldApi.ts:1250 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1250 )
416
416
417
417
Pushes a new value to the field.
418
418
@@ -438,7 +438,7 @@ Pushes a new value to the field.
438
438
removeValue (index , opts ? ): void
439
439
` ` `
440
440
441
- Defined in: [packages/form-core/src/FieldApi.ts:1284 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1284 )
441
+ Defined in: [packages/form-core/src/FieldApi.ts:1288 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1288 )
442
442
443
443
Removes a value at the specified index.
444
444
@@ -467,7 +467,7 @@ replaceValue(
467
467
opts ? ): void
468
468
` ` `
469
469
470
- Defined in: [packages/form-core/src/FieldApi.ts:1271 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1271 )
470
+ Defined in: [packages/form-core/src/FieldApi.ts:1275 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1275 )
471
471
472
472
Replaces a value at the specified index.
473
473
@@ -497,7 +497,7 @@ Replaces a value at the specified index.
497
497
setErrorMap (errorMap ): void
498
498
` ` `
499
499
500
- Defined in: [packages/form-core/src/FieldApi.ts:1670 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1670 )
500
+ Defined in: [packages/form-core/src/FieldApi.ts:1674 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1674 )
501
501
502
502
Updates the field's errorMap
503
503
@@ -519,7 +519,7 @@ Updates the field's errorMap
519
519
setMeta (updater ): void
520
520
` ` `
521
521
522
- Defined in: [packages/form-core/src/FieldApi.ts:1214 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1214 )
522
+ Defined in: [packages/form-core/src/FieldApi.ts:1218 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1218 )
523
523
524
524
Sets the field metadata.
525
525
@@ -541,7 +541,7 @@ Sets the field metadata.
541
541
setValue (updater , options ? ): void
542
542
` ` `
543
543
544
- Defined in: [packages/form-core/src/FieldApi.ts:1201 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1201 )
544
+ Defined in: [packages/form-core/src/FieldApi.ts:1205 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1205 )
545
545
546
546
Sets the field value and run the ` change ` validator.
547
547
@@ -570,7 +570,7 @@ swapValues(
570
570
opts ? ): void
571
571
` ` `
572
572
573
- Defined in: [packages/form-core/src/FieldApi.ts:1293 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1293 )
573
+ Defined in: [packages/form-core/src/FieldApi.ts:1297 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1297 )
574
574
575
575
Swaps the values at the specified indices.
576
576
@@ -600,7 +600,7 @@ Swaps the values at the specified indices.
600
600
update (opts ): void
601
601
` ` `
602
602
603
- Defined in: [packages/form-core/src/FieldApi.ts:1137 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1137 )
603
+ Defined in: [packages/form-core/src/FieldApi.ts:1141 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1141 )
604
604
605
605
Updates the field instance with new options.
606
606
@@ -622,7 +622,7 @@ Updates the field instance with new options.
622
622
validate (cause , opts ? ): unknown [] | Promise < unknown []>
623
623
` ` `
624
624
625
- Defined in: [packages/form-core/src/FieldApi.ts:1613 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1613 )
625
+ Defined in: [packages/form-core/src/FieldApi.ts:1617 ](https://github.com/TanStack/form/blob/main/packages/form-core/src/FieldApi.ts#L1617 )
626
626
627
627
Validates the field value.
628
628
0 commit comments