pmndrs / jotai

👻 Primitive and flexible state management for React

Home Page:https://jotai.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

selectAtom not working any more

joacub opened this issue · comments

commented

Summary

selectAtom is returning for async atoms always a promise which cause a hooks to return a throw (promise), we expect that the hook just return the state if the state is not ready then do not return the state and set the sate later.

but now it is imposible to use the hook as this always return an promise like error and never update the state.

Please provide a minimal reproduction, preferably with https://csb.jotai.org.
I will close it for now and reopen it once provided.

If this is an issue with async behavior, I assume it can be reproduced without selectAtom.
Or, do you think it's selectAtom specific issue?

I will close it for now and reopen it once provided.

On second thought, I'm converting this to a discussion, because #1158 is a closed issue.