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
{{ message }}
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
When this transaction setter is used, the above error occurs, so long as the default value of the atom is set by a selector. Here is a minimal reproducible example: link
My understand of this so far is that this is simply not allowed, although I'm not sure I. understand why.
What I'd like to know is whether there is any way around this. How can I both ensure a transactional update to a set of pieces of state (what useRecoilTransaction allows) and set my atom state by default. (Note: I tried to use Atom Effects here briefly, but I couldn't get the error handling to work properly. The effects seemed to swallow errors).
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have some state management code using Recoil where I'm running into the error:
I understand how this error is occurring. I have some atoms that follow the pattern of using selectors to set default values like this:
The problem occurs when I use
useRecoilTransaction__UNSTABLE
later to try to set this selector, e.g.:When this transaction setter is used, the above error occurs, so long as the
default
value of the atom is set by a selector. Here is a minimal reproducible example: linkMy understand of this so far is that this is simply not allowed, although I'm not sure I. understand why.
What I'd like to know is whether there is any way around this. How can I both ensure a transactional update to a set of pieces of state (what useRecoilTransaction allows) and set my atom state by default. (Note: I tried to use Atom Effects here briefly, but I couldn't get the error handling to work properly. The effects seemed to swallow errors).
The text was updated successfully, but these errors were encountered: