Apply values from one object in state to another object in state? #702
Unanswered
jameschetwood
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Ah so its a simple fix with lodash's cloneDeep. Not sure if this is best practice though?
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have one object in state "a" and I apply the values from this to another object "b". When I mutate "b" and then reapply "a" it has the mutated not original value. I need the original values to be reapplied.
Here is my example code
https://codesandbox.io/s/confident-wildflower-d43w8r?file=/src/App.js:0-787
Here is a video recording of the issue: https://www.loom.com/share/0f11ba769f2a403dbf867b0cca315afa
The steps are:
Beta Was this translation helpful? Give feedback.
All reactions