Anyone here has tried jotai with rescript?

I’m thinking about replacing recoil with jotai. I’m using Next.js.
I noticed that recoil has a big bundle size and it has some hot-reloading issues like getting out of sync and posting a lot of noise in console.log.

Any idea if it’s worth the trouble of switching?
I also took a look at valtio but that one I don’t think it would play nicely with rescript since it seems like it’s mutable by design.

I’m currently experimenting with bindings for a work project, but I’m having a difficult time modelling the API given that Jotai has an overly polymorphic interface (Zustand also suffers from this).

For the time being, I’m just binding to the exported hooks (useAtom, etc.). I think that it’s probably simplest to write a binding for a single atom entry point (readable, writable) instead of wasting time on the polymorphism.

1 Like

Sorry for the self promotion :disappointed:

We’re using Jotai on a new project with some homemade bindings you can find here. So far so good, I really like the simplicity of the API compared to Recoil.

Since we use Jotai only in some particular cases (Modals, Notifications, Menus, etc…) I can’t guarantee it works well for bigger projects, or projects that rely heavily on global state management though :confused:

5 Likes

thanks for the bindings!
Good to know that you’ve used it

I’ll give it a try

Nice, thanks for sharing!