Open History to see the last commit
1---
2id: FormState
3title: FormState
4---
5β
6# Interface: FormState\<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer\>
7β
8Defined in: [packages/form-core/src/FormApi.ts:718](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L718)
9β
10An object representing the current state of the form.
11β
12## Extends
13β
14- [`BaseFormState`](../type-aliases/BaseFormState.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnDynamic`, `TOnDynamicAsync`, `TOnServer`\>.[`DerivedFormState`](../type-aliases/DerivedFormState.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnDynamic`, `TOnDynamicAsync`, `TOnServer`\>
15β
16## Type Parameters
17β
18### TFormData
19β
20`TFormData`
21β
22### TOnMount
23β
24`TOnMount` *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
25β
26### TOnChange
27β
28`TOnChange` *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
29β
30### TOnChangeAsync
31β
32`TOnChangeAsync` *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
33β
34### TOnBlur
35β
36`TOnBlur` *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
37β
38### TOnBlurAsync
39β
40`TOnBlurAsync` *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
41β
42### TOnSubmit
43β
44`TOnSubmit` *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
45β
46### TOnSubmitAsync
47β
48`TOnSubmitAsync` *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
49β
50### TOnDynamic
51β
52`TOnDynamic` *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
53β
54### TOnDynamicAsync
55β
56`TOnDynamicAsync` *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
57β
58### TOnServer
59β
60`TOnServer` *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
61β
62## Properties
63β
64### \_force\_re\_eval?
65β
66```ts
67optional _force_re_eval: boolean;
68```
69β
70Defined in: [packages/form-core/src/FormApi.ts:623](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L623)
71β
72@private, used to force a re-evaluation of the form state when options change
73β
74#### Inherited from
75β
76```ts
77BaseFormState._force_re_eval
78```
79β
80***
81β
82### canSubmit
83β
84```ts
85canSubmit: boolean;
86```
87β
88Defined in: [packages/form-core/src/FormApi.ts:711](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L711)
89β
90A boolean indicating if the form can be submitted based on its current state.
91β
92#### Inherited from
93β
94```ts
95DerivedFormState.canSubmit
96```
97β
98***
99β
100### errorMap
101β
102```ts
103errorMap: ValidationErrorMap<UnwrapFormValidateOrFn<TOnMount>, UnwrapFormValidateOrFn<TOnChange>, UnwrapFormAsyncValidateOrFn<TOnChangeAsync>, UnwrapFormValidateOrFn<TOnBlur>, UnwrapFormAsyncValidateOrFn<TOnBlurAsync>, UnwrapFormValidateOrFn<TOnSubmit>, UnwrapFormAsyncValidateOrFn<TOnSubmitAsync>, UnwrapFormValidateOrFn<TOnDynamic>, UnwrapFormAsyncValidateOrFn<TOnDynamicAsync>, UnwrapFormAsyncValidateOrFn<TOnServer>>;
104```
105β
106Defined in: [packages/form-core/src/FormApi.ts:567](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L567)
107β
108The error map for the form itself.
109β
110#### Inherited from
111β
112```ts
113BaseFormState.errorMap
114```
115β
116***
117β
118### errors
119β
120```ts
121errors: (
122 | UnwrapFormValidateOrFn<TOnMount>
123 | UnwrapFormValidateOrFn<TOnChange>
124 | UnwrapFormAsyncValidateOrFn<TOnChangeAsync>
125 | UnwrapFormValidateOrFn<TOnBlur>
126 | UnwrapFormAsyncValidateOrFn<TOnBlurAsync>
127 | UnwrapFormValidateOrFn<TOnSubmit>
128 | UnwrapFormAsyncValidateOrFn<TOnSubmitAsync>
129 | UnwrapFormValidateOrFn<TOnDynamic>
130 | UnwrapFormAsyncValidateOrFn<TOnDynamicAsync>
131 | UnwrapFormAsyncValidateOrFn<TOnServer>)[];
132```
133β
134Defined in: [packages/form-core/src/FormApi.ts:664](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L664)
135β
136The error array for the form itself.
137β
138#### Inherited from
139β
140```ts
141DerivedFormState.errors
142```
143β
144***
145β
146### fieldMeta
147β
148```ts
149fieldMeta: Partial<Record<DeepKeys<TFormData>, AnyFieldMeta>>;
150```
151β
152Defined in: [packages/form-core/src/FormApi.ts:715](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L715)
153β
154A record of field metadata for each field in the form.
155β
156#### Inherited from
157β
158```ts
159DerivedFormState.fieldMeta
160```
161β
162***
163β
164### fieldMetaBase
165β
166```ts
167fieldMetaBase: Partial<Record<DeepKeys<TFormData>, AnyFieldMetaBase>>;
168```
169β
170Defined in: [packages/form-core/src/FormApi.ts:586](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L586)
171β
172A record of field metadata for each field in the form, not including the derived properties, like `errors` and such
173β
174#### Inherited from
175β
176```ts
177BaseFormState.fieldMetaBase
178```
179β
180***
181β
182### isBlurred
183β
184```ts
185isBlurred: boolean;
186```
187β
188Defined in: [packages/form-core/src/FormApi.ts:691](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L691)
189β
190A boolean indicating if any of the form fields have been blurred.
191β
192#### Inherited from
193β
194```ts
195DerivedFormState.isBlurred
196```
197β
198***
199β
200### isDefaultValue
201β
202```ts
203isDefaultValue: boolean;
204```
205β
206Defined in: [packages/form-core/src/FormApi.ts:703](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L703)
207β
208A boolean indicating if all of the form's fields are the same as default values.
209β
210#### Inherited from
211β
212```ts
213DerivedFormState.isDefaultValue
214```
215β
216***
217β
218### isDirty
219β
220```ts
221isDirty: boolean;
222```
223β
224Defined in: [packages/form-core/src/FormApi.ts:695](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L695)
225β
226A boolean indicating if any of the form's fields' values have been modified by the user. Evaluates `true` if the user have modified at least one of the fields. Opposite of `isPristine`.
227β
228#### Inherited from
229β
230```ts
231DerivedFormState.isDirty
232```
233β
234***
235β
236### isFieldsValid
237β
238```ts
239isFieldsValid: boolean;
240```
241β
242Defined in: [packages/form-core/src/FormApi.ts:683](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L683)
243β
244A boolean indicating if all the form fields are valid. Evaluates `true` if there are no field errors.
245β
246#### Inherited from
247β
248```ts
249DerivedFormState.isFieldsValid
250```
251β
252***
253β
254### isFieldsValidating
255β
256```ts
257isFieldsValidating: boolean;
258```
259β
260Defined in: [packages/form-core/src/FormApi.ts:679](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L679)
261β
262A boolean indicating if any of the form fields are currently validating.
263β
264#### Inherited from
265β
266```ts
267DerivedFormState.isFieldsValidating
268```
269β
270***
271β
272### isFormValid
273β
274```ts
275isFormValid: boolean;
276```
277β
278Defined in: [packages/form-core/src/FormApi.ts:660](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L660)
279β
280A boolean indicating if the form is valid.
281β
282#### Inherited from
283β
284```ts
285DerivedFormState.isFormValid
286```
287β
288***
289β
290### isFormValidating
291β
292```ts
293isFormValidating: boolean;
294```
295β
296Defined in: [packages/form-core/src/FormApi.ts:656](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L656)
297β
298A boolean indicating if the form is currently validating.
299β
300#### Inherited from
301β
302```ts
303DerivedFormState.isFormValidating
304```
305β
306***
307β
308### isPristine
309β
310```ts
311isPristine: boolean;
312```
313β
314Defined in: [packages/form-core/src/FormApi.ts:699](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L699)
315β
316A boolean indicating if none of the form's fields' values have been modified by the user. Evaluates `true` if the user have not modified any of the fields. Opposite of `isDirty`.
317β
318#### Inherited from
319β
320```ts
321DerivedFormState.isPristine
322```
323β
324***
325β
326### isSubmitSuccessful
327β
328```ts
329isSubmitSuccessful: boolean;
330```
331β
332Defined in: [packages/form-core/src/FormApi.ts:619](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L619)
333β
334A boolean indicating if the last submission was successful.
335β
336#### Inherited from
337β
338```ts
339BaseFormState.isSubmitSuccessful
340```
341β
342***
343β
344### isSubmitted
345β
346```ts
347isSubmitted: boolean;
348```
349β
350Defined in: [packages/form-core/src/FormApi.ts:607](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L607)
351β
352A boolean indicating if the `onSubmit` function has completed successfully.
353β
354Goes back to `false` at each new submission attempt.
355β
356Note: you can use isSubmitting to check if the form is currently submitting.
357β
358#### Inherited from
359β
360```ts
361BaseFormState.isSubmitted
362```
363β
364***
365β
366### isSubmitting
367β
368```ts
369isSubmitting: boolean;
370```
371β
372Defined in: [packages/form-core/src/FormApi.ts:599](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L599)
373β
374A boolean indicating if the form is currently in the process of being submitted after `handleSubmit` is called.
375β
376Goes back to `false` when submission completes for one of the following reasons:
377- the validation step returned errors.
378- the `onSubmit` function has completed.
379β
380Note: if you're running async operations in your `onSubmit` function make sure to await them to ensure `isSubmitting` is set to `false` only when the async operation completes.
381β
382This is useful for displaying loading indicators or disabling form inputs during submission.
383β
384#### Inherited from
385β
386```ts
387BaseFormState.isSubmitting
388```
389β
390***
391β
392### isTouched
393β
394```ts
395isTouched: boolean;
396```
397β
398Defined in: [packages/form-core/src/FormApi.ts:687](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L687)
399β
400A boolean indicating if any of the form fields have been touched.
401β
402#### Inherited from
403β
404```ts
405DerivedFormState.isTouched
406```
407β
408***
409β
410### isValid
411β
412```ts
413isValid: boolean;
414```
415β
416Defined in: [packages/form-core/src/FormApi.ts:707](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L707)
417β
418A boolean indicating if the form and all its fields are valid. Evaluates `true` if there are no errors.
419β
420#### Inherited from
421β
422```ts
423DerivedFormState.isValid
424```
425β
426***
427β
428### isValidating
429β
430```ts
431isValidating: boolean;
432```
433β
434Defined in: [packages/form-core/src/FormApi.ts:611](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L611)
435β
436A boolean indicating if the form or any of its fields are currently validating.
437β
438#### Inherited from
439β
440```ts
441BaseFormState.isValidating
442```
443β
444***
445β
446### submissionAttempts
447β
448```ts
449submissionAttempts: number;
450```
451β
452Defined in: [packages/form-core/src/FormApi.ts:615](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L615)
453β
454A counter for tracking the number of submission attempts.
455β
456#### Inherited from
457β
458```ts
459BaseFormState.submissionAttempts
460```
461β
462***
463β
464### validationMetaMap
465β
466```ts
467validationMetaMap: Record<ValidationErrorMapKeys, ValidationMeta | undefined>;
468```
469β
470Defined in: [packages/form-core/src/FormApi.ts:582](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L582)
471β
472An internal mechanism used for keeping track of validation logic in a form.
473β
474#### Inherited from
475β
476```ts
477BaseFormState.validationMetaMap
478```
479β
480***
481β
482### values
483β
484```ts
485values: TFormData;
486```
487β
488Defined in: [packages/form-core/src/FormApi.ts:563](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L563)
489β
490The current values of the form fields.
491β
492#### Inherited from
493β
494```ts
495BaseFormState.values
496```