I need to update the table datasource after I get the response from onSave method.
However, after I call my setDataSource function (also provided to EditableProTable with onChange={setDataSource}, the component calls the same setDataSource method with existing information and overwrites my chanes.
📷 Reproduction steps
Implement EditableProTable. Provide dataSource and onChange from local state.
Implement onSave that calls setDataSource with a value that doesn't exist on frontend yet.
Edit the row and save
Observe setDataSource calls
Comment onChange out and test edit->save again and observe that the datasource is updated as expected.
🏞 Expected results
Data source is updated with the data from backend and it is not overwritten by the table component.
💻 Reproduction code
Uuid is empty on init. onSave adds it (please leave it blank for the purpose of reproduction.
Note: My case is different and uuid is just some test name.
🐛 Bug description
I need to update the table datasource after I get the response from onSave method.
However, after I call my setDataSource function (also provided to EditableProTable with
onChange={setDataSource}
, the component calls the same setDataSource method with existing information and overwrites my chanes.📷 Reproduction steps
🏞 Expected results
Data source is updated with the data from backend and it is not overwritten by the table component.
💻 Reproduction code
Uuid is empty on init. onSave adds it (please leave it blank for the purpose of reproduction.
Note: My case is different and uuid is just some test name.
https://codesandbox.io/p/sandbox/wizardly-currying-t7qcgk
© Version information
🚑 Other information
I am open to built in callback function to update the data on save like promise.resolve.