React getFieldDecorator initialValue

< FormItem label= "title" {.formItemLayout} >

{getFieldDecorator("Title",{initialValue:this.state.baseData?this.state.baseData.title:""}, {
    rules: [{
        required: true,
        whitespace: true,
        message: "",
    }],
})(
    <Input type="text" />
)}

< / FormItem >

question: after the API request, after the page initializes and assigns values to the form, manually clear the values in input. Why does the rule judgment of rules not work?

Apr.01,2021
Menu