The problem of updating the initial value of react antd getFieldDecorator

when I initialize the Input component of the Form form, I set the initalValue property of getFieldDecorator . This initial value depends on the value stored in Redux , and the Redux value is the data passed in the background.

the problem now is that when I click Save and modify successfully, the data will be pulled again and the data passed by the background will be updated. The value of redux is also updated, while initalValue is not updated dynamically. The page will not be updated until it is refreshed.

try to use setFieldsValue to set the value of Input , but it can cause an endless loop in many lifecycles.

is there any way to make the value of the Input component change with the data in Redux ?

Mar.10,2021

in the method that you click to save, just resetFields . The options in the Form.create (options) (ReactNode) method in


antd can do this. For more information on how to use it, please see the document https://2x.ant.design/compone.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bea05f-319bb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bea05f-319bb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?