problem description
use ant design Form.create to create a form and report an error You cannot set field before registering it when you need to display the error in the background on the corresponding attribute.
the environmental background of the problems and what methods you have tried
after messing around for a long time, when I found the reason, the form object was set to null, so the error information could not be set with the form.setFileds method
.related codes
/ / Please paste the code text below (do not replace the code with pictures)
let FormEle = Form.create({
fieldNameProp: "appbir"
})(CustomizedForm);
<Panel disabled={disabled} header={header} key={index}>
<FormEle wrappedComponentRef={(ref) => {
formInstance[index]=ref.props.form;
}}/>
</Panel>
ref.props.form returns null
what result do you expect? What is the error message actually seen?
do not set form to null