-
-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Derived dependent atoms not updating during multiple sets #2107
Comments
Thanks for reporting. Meanwhile, if this is a regression from 2.3.1, can you try and see which causes it?
You can install the codesandbox build in those PRs. |
Attached a repo. Changing from 2.4.1 to 2.3.1 in the package.json will change the behavior of this button (2.4.1) Missmatch 1 undefined I believe that it might be related to the work on #2086 which was my initial hunch. I will try and test them individually |
Confirmed that it is #2086 that introduces the behavior change |
Thanks. Is it possible for you to try it with Jotai v1.13.1? #2086 was to fix a regression from v1. |
1.13.1 has the same behavior as 2.3.1 where the values match. |
Thanks. Yeah, this seems a regression with fixing another regression from v1... |
Confirmed #2111 resolves issue. Nice work on the PR. That looks like a non trivial update. |
Summary
I am seeing a change from 2.3.1 to 2.4.1 where atoms that are updated that have derived values using that atom are not updated
I commonly use
backing
fields for my atoms with custom setters that set the backing field and may set multiple other atoms.The change between the versions is that when doing a set() on the backing field and then another set() for another atom() that uses that backing field. It is fine. But if that atom() uses another atom that uses the backing field it has not been updated yet.
Here is my quick psuedo code of the issue
Link to reproduction
https://codesandbox.io/s/jotai-2-4-1-regression-kmclx3?file=/src/App.tsx
The text was updated successfully, but these errors were encountered: