react-component / form

React High Order Form Component(web & react-native)
http://react-component.github.io/form/
MIT License
1.81k stars 296 forks source link

Reinitialize initialValue #413

Closed nibiru2O12 closed 4 years ago

nibiru2O12 commented 4 years ago

Can we re-initialize initialValue on getfielddecorator ?

I have a form for viewing and updating. It was setup like this.

My problem is on Save button, once the data is saved i need to update the initialValue to be equal to the updated from retrieved from database, but initialValue is not updated.

I can use form.setFieldsValue to populate form with the updated data, but when "Edit" is clicked, then click "Cancel", fields is reset and populated by the 1st initialValue (not updated data).