Browse Source

fix: form update state error before form mounted (#5406)

Netfan 2 months ago
parent
commit
c3129663eb
1 changed files with 1 additions and 2 deletions
  1. 1 2
      packages/@core/ui-kit/form-ui/src/form-api.ts

+ 1 - 2
packages/@core/ui-kit/form-ui/src/form-api.ts

@@ -404,9 +404,8 @@ export class FormApi {
       const deletedSchema = prevSchema.filter(
         (item) => !currentFields.has(item.fieldName),
       );
-
       for (const schema of deletedSchema) {
-        this.form?.setFieldValue(schema.fieldName, undefined);
+        this.form?.setFieldValue?.(schema.fieldName, undefined);
       }
     }
   }