Replies: 1 comment 2 replies
-
Yes, it looks good. Check out https://github.com/jotaijs/jotai-scope, |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It took me a while to understand how to use
Provider
+store
and get this to work but I wanted to share my implementation ofuseScopedAtom
+ScopeProvider
, and maybe get some feedback on whether this is how jotai is "supposed" to be used.🔗 Open in stackblitz
This essentially creates a new, standalone scope every time
<ScopeProvider>
is used. The implementation could be easily extended to create overlapping scopes that are completely independent of each other.This is different from how
Provider
works out of the box — when a<Provider>
is used, it overrides all state (global side effect). The default behavior ofProvider
makes it difficult to use jotai as an implementation detail within libraries, because it would conflict with application state.Beta Was this translation helpful? Give feedback.
All reactions