How to update a useSnapshot() instance #812
-
Hi
now, i want to operate some filtering, which means updating the state.group array:
, but when i do the snapshot obtained from useSnapshot doesn't get updated (i understand this to be by design, as useSnapshot stores the "state" object "as is" ). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Can you elaborate what is not updated? I think it gets updated by React re-rendering. |
Beta Was this translation helpful? Give feedback.
It should be updated but maybe the
.map()
usage on the snapshot is tricky.Would you be able to create a very small example with https://codesandbox.io/s/react-new ?
No styles are needed. Just one single
App.js
file would be good.