diff --git a/packages/core/src/models/Graph.ts b/packages/core/src/models/Graph.ts index 5a89af1c78e..d1275d065bf 100644 --- a/packages/core/src/models/Graph.ts +++ b/packages/core/src/models/Graph.ts @@ -50,9 +50,9 @@ export class Graph { } else { const field = form.fields[address] if (field) { - field.setState(state as any) + field.setState(state) } else { - createField(address, state).setState(state as any) + createField(address, state).setState(state) } } }) diff --git a/packages/core/src/shared/internals.ts b/packages/core/src/shared/internals.ts index f07e39c20da..ea9d586f83d 100644 --- a/packages/core/src/shared/internals.ts +++ b/packages/core/src/shared/internals.ts @@ -39,6 +39,7 @@ import { IFormFeedback, LifeCycleTypes, FieldMatchPattern, + FieldFeedbackTypes, } from '../types' import { isArrayField, @@ -312,13 +313,13 @@ export const validateToFeedbacks = async ( }) batch(() => { - each(results, (messages, type) => { + each(results, (messages, type: FieldFeedbackTypes) => { field.setFeedback({ triggerType, type, code: pascalCase(`validate-${type}`), messages: messages, - } as any) + }) }) }) return results