@@ -129,7 +129,7 @@ export class FieldApi<TData, TFormData> {
129
129
130
130
this . state = this . store . state
131
131
this . prevState = this . state
132
- this . update ( opts as never )
132
+ this . options = opts as never
133
133
}
134
134
135
135
mount = ( ) => {
@@ -151,6 +151,7 @@ export class FieldApi<TData, TFormData> {
151
151
} )
152
152
} )
153
153
154
+ this . update ( this . options as never )
154
155
this . options . onMount ?.( this as never )
155
156
156
157
return ( ) => {
@@ -163,33 +164,25 @@ export class FieldApi<TData, TFormData> {
163
164
}
164
165
165
166
update = ( opts : FieldApiOptions < typeof this . _tdata , TFormData > ) => {
166
- this . options = {
167
- asyncDebounceMs : this . form . options . asyncDebounceMs ?? 0 ,
168
- ...opts ,
169
- } as never
170
-
171
167
// Default Value
172
168
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
173
169
if ( this . state . value === undefined ) {
174
- if ( this . options . defaultValue !== undefined ) {
175
- this . setValue ( this . options . defaultValue as never )
176
- } else if (
177
- opts . form . options . defaultValues ?. [
178
- this . options . name as keyof TFormData
179
- ] !== undefined
180
- ) {
181
- this . setValue (
182
- opts . form . options . defaultValues [
183
- this . options . name as keyof TFormData
184
- ] as never ,
185
- )
170
+ const formDefault =
171
+ opts . form . options . defaultValues ?. [ opts . name as keyof TFormData ]
172
+
173
+ if ( opts . defaultValue !== undefined ) {
174
+ this . setValue ( opts . defaultValue as never )
175
+ } else if ( formDefault !== undefined ) {
176
+ this . setValue ( formDefault as never )
186
177
}
187
178
}
188
179
189
180
// Default Meta
190
181
if ( this . _getMeta ( ) === undefined ) {
191
182
this . setMeta ( this . state . meta )
192
183
}
184
+
185
+ this . options = opts as never
193
186
}
194
187
195
188
getValue = ( ) : typeof this . _tdata => {
0 commit comments