We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
mix-use of useState and valtio.derive will make the component read the stale value of the derived proxy.
https://codesandbox.io/s/valtio-mix-with-state-ielduu?file=/src/App.tsx
Though this example seems harmless, this inconsistency brokes my project (in the progress of migration from redux to valtio).
but it works fine if use valtio only, https://codesandbox.io/s/valtio-not-mix-with-state-2j4ocl?file=/src/App.tsx
BTW, I've tested jotai, it also works, https://codesandbox.io/s/brave-drake-qsvvz5?file=/src/App.tsx, would you suggest using jotai instead?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
mix-use of useState and valtio.derive will make the component read the stale value of the derived proxy.
Link to reproduction
https://codesandbox.io/s/valtio-mix-with-state-ielduu?file=/src/App.tsx
Though this example seems harmless, this inconsistency brokes my project (in the progress of migration from redux to valtio).
but it works fine if use valtio only, https://codesandbox.io/s/valtio-not-mix-with-state-2j4ocl?file=/src/App.tsx
BTW, I've tested jotai, it also works, https://codesandbox.io/s/brave-drake-qsvvz5?file=/src/App.tsx, would you suggest using jotai instead?
The text was updated successfully, but these errors were encountered: