You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not exactly that, I think, because I noticed while debugging you don't always do a deep copy if you don't need to.
So the rule seems to be: it is as if you do a deep copy, and then you can "mutate" it like there is no tomorrow with that new copy, and then setData(newData). That may be an easy way to think about. Maybe you can add it to the README if it can help some users.
The text was updated successfully, but these errors were encountered:
I am not too familiar with useReducer yet, but it seems useImmer can support
setCount(c => c + 1)
orsetToggle(t => !t)
.The current README doesn't say this but just say
setCount(count + 1)
.Also, the way to think about
is just like
not exactly that, I think, because I noticed while debugging you don't always do a deep copy if you don't need to.
So the rule seems to be: it is as if you do a deep copy, and then you can "mutate" it like there is no tomorrow with that new copy, and then
setData(newData)
. That may be an easy way to think about. Maybe you can add it to the README if it can help some users.The text was updated successfully, but these errors were encountered: