I'm new in React/Redux and I don't know how to deal with my problem, so I decide to ask you. I'm using react-bootstrap-table to show data in table where I can add or edit row. My problem occurring during edit row. When row was clicked I'm opening modal, where I can edit all properties of row. To deal with change data I'm creating new object with all properties of row and after save I'm sending this object to server. But when someone for example clean input and press Cancel button, modal dissapears, but cell which data was cleaned is empty. After refresh, cell has data before change. And that's my question, how to deal with this problem? I have object with ID of this row, so I can get old data from server, but I don't know is it good idea? Maybe you have better idea? Thanks for every reply.
Asked
Active
Viewed 129 times
0
-
1can you show some code? – vijayst Aug 01 '17 at 12:53
1 Answers
0
You should edit the deep copy of the data. You can use deep-extend or any other libraries to make a deep copy of the data object (you can even write one yourself).

Kamil Socha
- 299
- 1
- 10
-
Thank's for your answer! To solved the problem I used cloneDeep from lodash library. – Patryk Aug 21 '17 at 13:45