useSnapshot: assignment to nested object ignored as "no-op", but later trigger causes outdated change to appear #1222
Unanswered
ziyuancc
asked this question in
Bug report
Replies: 1 comment 2 replies
-
|
This is an expected (though confusing) behavior. const nextVal = snap.info.list?.map((item: any) => item.id).join('');
useEffect(() => {
setVal(nextVal);
}, [nextVal]); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Minimal reproduction
Beta Was this translation helpful? Give feedback.
All reactions