Replies: 1 comment
-
typo found |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
typo found |
Beta Was this translation helpful? Give feedback.
-
I have a store that contains a map ,and the currently selected item
A sub component will allow user to update the currently selected item.
I made a function that clones the map and sets it (as per docs) , the string fields on the selected object update but
the one that is an array of strings does not ( the "missions" filed)
the test case I have been doing is select the "200" button at top set all values to "2" , then press the "100" and set them
all to "1" as you click on the different buttons after doing this , you will see the mission field is not changing beyond its last update
Obviously this is part of more complex app I am working on for a game, but have extracted a simplified form of it here
https://codesandbox.io/p/sandbox/zustand-arrayupdate-issue-tn7jx3?file=%2Fsrc%2FSimpleEdit.jsx%3A33%2C12
I've been banging my head against it for a while and hoping the community can point out a simple fix
Beta Was this translation helpful? Give feedback.
All reactions