Form form bug in ant-design

Code:

<FormItem
 label = " Amount "
 >
 {getFieldDecorator( 'principal' , {
         initialValue : this . state . record . principal , //initialValue must be before rules , otherwise it will cause initialValue not to update
 rules : [{
             required : true , message : ' Please enter the amount !' ,
 }]                        
    })(
        <Input addonBefore="" />
    )}
</FormItem>
The initialValue here must be before rules, otherwise: when the form is loaded for the first time, the initial value can be loaded correctly; when the form is loaded for the second time, the initial value is still the initial value of the form the first time. It is estimated that it is a bug of ant-design.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325989625&siteId=291194637