@@ -7,7 +7,7 @@ title: FormOptions
7
7
8
8
# Interface: FormOptions\< TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta\>
9
9
10
- Defined in: [ packages/form-core/src/FormApi.ts:239 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L239 )
10
+ Defined in: [ packages/form-core/src/FormApi.ts:319 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L319 )
11
11
12
12
An object representing the options for a form.
13
13
@@ -41,7 +41,7 @@ An object representing the options for a form.
41
41
optional asyncAlways : boolean ;
42
42
```
43
43
44
- Defined in: [ packages/form-core/src/FormApi.ts:274 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L274 )
44
+ Defined in: [ packages/form-core/src/FormApi.ts:354 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L354 )
45
45
46
46
If true, always run async validation, even when sync validation has produced an error. Defaults to undefined.
47
47
@@ -53,7 +53,7 @@ If true, always run async validation, even when sync validation has produced an
53
53
optional asyncDebounceMs : number ;
54
54
```
55
55
56
- Defined in: [ packages/form-core/src/FormApi.ts:278 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L278 )
56
+ Defined in: [ packages/form-core/src/FormApi.ts:358 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L358 )
57
57
58
58
Optional time in milliseconds if you want to introduce a delay before firing off an async action.
59
59
@@ -65,7 +65,7 @@ Optional time in milliseconds if you want to introduce a delay before firing off
65
65
optional canSubmitWhenInvalid : boolean ;
66
66
```
67
67
68
- Defined in: [ packages/form-core/src/FormApi.ts:282 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L282 )
68
+ Defined in: [ packages/form-core/src/FormApi.ts:362 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L362 )
69
69
70
70
If true, allows the form to be submitted in an invalid state i.e. canSubmit will remain true regardless of validation errors. Defaults to undefined.
71
71
@@ -77,7 +77,7 @@ If true, allows the form to be submitted in an invalid state i.e. canSubmit will
77
77
optional defaultState : Partial < FormState < TFormData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TOnServer >> ;
78
78
```
79
79
80
- Defined in: [ packages/form-core/src/FormApi.ts:258 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L258 )
80
+ Defined in: [ packages/form-core/src/FormApi.ts:338 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L338 )
81
81
82
82
The default state for the form.
83
83
@@ -89,19 +89,31 @@ The default state for the form.
89
89
optional defaultValues : TFormData ;
90
90
```
91
91
92
- Defined in: [ packages/form-core/src/FormApi.ts:254 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L254 )
92
+ Defined in: [ packages/form-core/src/FormApi.ts:334 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L334 )
93
93
94
94
Set initial values for your form.
95
95
96
96
***
97
97
98
+ ### listeners?
99
+
100
+ ``` ts
101
+ optional listeners : FormListeners < TFormData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync , TOnServer , TSubmitMeta > ;
102
+ ```
103
+
104
+ Defined in: [ packages/form-core/src/FormApi.ts:385] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L385 )
105
+
106
+ form level listeners
107
+
108
+ ***
109
+
98
110
### onSubmit()?
99
111
100
112
``` ts
101
113
optional onSubmit : (props ) => any ;
102
114
```
103
115
104
- Defined in: [ packages/form-core/src/FormApi.ts:305 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L305 )
116
+ Defined in: [ packages/form-core/src/FormApi.ts:401 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L401 )
105
117
106
118
A function to be called when the form is submitted, what should happen once the user submits a valid form returns ` any ` or a promise ` Promise<any> `
107
119
@@ -133,7 +145,7 @@ A function to be called when the form is submitted, what should happen once the
133
145
optional onSubmitInvalid : (props ) => void ;
134
146
```
135
147
136
- Defined in: [ packages/form-core/src/FormApi.ts:324 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L324 )
148
+ Defined in: [ packages/form-core/src/FormApi.ts:420 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L420 )
137
149
138
150
Specify an action for scenarios where the user tries to submit an invalid form.
139
151
@@ -161,7 +173,7 @@ Specify an action for scenarios where the user tries to submit an invalid form.
161
173
optional onSubmitMeta : TSubmitMeta ;
162
174
```
163
175
164
- Defined in: [ packages/form-core/src/FormApi.ts:300 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L300 )
176
+ Defined in: [ packages/form-core/src/FormApi.ts:380 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L380 )
165
177
166
178
onSubmitMeta, the data passed from the handleSubmit handler, to the onSubmit function props
167
179
@@ -173,7 +185,7 @@ onSubmitMeta, the data passed from the handleSubmit handler, to the onSubmit fun
173
185
optional transform : FormTransform < NoInfer < TFormData > , NoInfer < TOnMount > , NoInfer < TOnChange > , NoInfer < TOnChangeAsync > , NoInfer < TOnBlur > , NoInfer < TOnBlurAsync > , NoInfer < TOnSubmit > , NoInfer < TOnSubmitAsync > , NoInfer < TOnServer > , NoInfer < TSubmitMeta >> ;
174
186
```
175
187
176
- Defined in: [ packages/form-core/src/FormApi.ts:339 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L339 )
188
+ Defined in: [ packages/form-core/src/FormApi.ts:435 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L435 )
177
189
178
190
***
179
191
@@ -183,6 +195,6 @@ Defined in: [packages/form-core/src/FormApi.ts:339](https://github.com/TanStack/
183
195
optional validators : FormValidators < TFormData , TOnMount , TOnChange , TOnChangeAsync , TOnBlur , TOnBlurAsync , TOnSubmit , TOnSubmitAsync > ;
184
196
```
185
197
186
- Defined in: [ packages/form-core/src/FormApi.ts:286 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L286 )
198
+ Defined in: [ packages/form-core/src/FormApi.ts:366 ] ( https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L366 )
187
199
188
200
A list of validators to pass to the form
0 commit comments