Then there's setting state from outside the React tree. I need this when I'm deep in the bowels of prosemirror. xstate does a good job at this actually, but Zustand fundamentally doesn't like this.
In Jotai, you can say `getDefaultStore()` and `set()` from anywhere. No hooks ✨
In Jotai, you can say `getDefaultStore()` and `set()` from anywhere. No hooks ✨
Comments
I could see myself switching strategies for other state challenges. But I def recommend trying Jotai for a flipped perspective!
since they can be used everywhere, they can replace many uses of stores.
stores still have their place though, as they're more flexible for some use cases (and aren't tied to svelte)
I've been trying this out recently and find it quite simple and elegant. 🙂
You can simply do useStore.getState() or useStore.setState
Would need to see code to understand Ben's pain here