Skip to content

Commit 5319847

Browse files
authored
fix: prevent manually setting derived meta (#1480)
1 parent 1920ade commit 5319847

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/form-core/src/FieldApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ export class FieldApi<
12171217
*/
12181218
setMeta = (
12191219
updater: Updater<
1220-
FieldMeta<
1220+
FieldMetaBase<
12211221
TParentData,
12221222
TName,
12231223
TData,

packages/form-core/src/FormApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,7 @@ export class FormApi<
18441844
*/
18451845
setFieldMeta = <TField extends DeepKeys<TFormData>>(
18461846
field: TField,
1847-
updater: Updater<AnyFieldMeta>,
1847+
updater: Updater<AnyFieldMetaBase>,
18481848
) => {
18491849
this.baseStore.setState((prev) => {
18501850
return {

packages/form-core/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import type { FieldValidators } from './FieldApi'
2+
import type { FormValidators } from './FormApi'
13
import type {
24
GlobalFormValidationError,
35
ValidationCause,
46
ValidationError,
57
ValidationSource,
68
} from './types'
7-
import type { FormValidators } from './FormApi'
8-
import type { AnyFieldMeta, FieldValidators } from './FieldApi'
99

1010
export type UpdaterFn<TInput, TOutput = TInput> = (input: TInput) => TOutput
1111

0 commit comments

Comments
 (0)