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

This commit is contained in:
Netfan
2025-01-15 20:11:32 +08:00
committed by GitHub
parent 816d1f5a69
commit c3129663eb

View File

@@ -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);
}
}
}