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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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