@@ -129,7 +129,7 @@ export class FieldApi<TData, TFormData> {
129129
130130 this . state = this . store . state
131131 this . prevState = this . state
132- this . update ( opts as never )
132+ this . options = opts as never
133133 }
134134
135135 mount = ( ) => {
@@ -151,6 +151,7 @@ export class FieldApi<TData, TFormData> {
151151 } )
152152 } )
153153
154+ this . update ( this . options as never )
154155 this . options . onMount ?.( this as never )
155156
156157 return ( ) => {
@@ -163,33 +164,25 @@ export class FieldApi<TData, TFormData> {
163164 }
164165
165166 update = ( opts : FieldApiOptions < typeof this . _tdata , TFormData > ) => {
166- this . options = {
167- asyncDebounceMs : this . form . options . asyncDebounceMs ?? 0 ,
168- ...opts ,
169- } as never
170-
171167 // Default Value
172168 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
173169 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 )
186177 }
187178 }
188179
189180 // Default Meta
190181 if ( this . _getMeta ( ) === undefined ) {
191182 this . setMeta ( this . state . meta )
192183 }
184+
185+ this . options = opts as never
193186 }
194187
195188 getValue = ( ) : typeof this . _tdata => {
0 commit comments