Skip to content

Commit c74eccb

Browse files
author
Harry Whorlow
committed
fix: functionality of onMount
1 parent ea273a6 commit c74eccb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/form-core/src/FieldApi.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ export type FieldMetaBase<
588588
TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>,
589589
TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>,
590590
TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>,
591-
TFieldMetaExtension = {},
591+
TFieldMetaExtension extends object = {},
592592
> = {
593593
/**
594594
* A flag indicating whether the field has been touched.
@@ -1195,6 +1195,11 @@ export class FieldApi<
11951195
fieldApi: this,
11961196
})
11971197

1198+
this.setMeta((prev) => ({
1199+
...prev,
1200+
...this.options.meta?.(this.form.state),
1201+
}))
1202+
11981203
return cleanup
11991204
}
12001205

0 commit comments

Comments
 (0)