When setAtom in timeout or async function will update component twice and with different value #2797
Answered
by
dai-shi
shenweizheng110
asked this question in
Bug report
-
Beta Was this translation helpful? Give feedback.
Answered by
dai-shi
Nov 5, 2024
Replies: 1 comment 11 replies
-
Hi, thanks for reporting. I have two quick things to confirm:
|
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's a known behavior. With v17, you need to use
unstable_batchedUpdates
for this case.Check it out: https://stackblitz.com/edit/vitejs-vite-t8lzju?file=src%2FApp.tsx&terminal=dev