Zedux vs Jotai #241
Replies: 1 comment 2 replies
-
Thanks for asking @VCasecnikovs. I'll make a code-level comparison in the docs soon. Here are some high-level advantages of each solution. But first, I want to say Jotai is a great tool. Zedux exists because of Jotai's shortcomings, but if one or two things were different, we'd be using Jotai today. I'll be assuming Zedux v2 for most of this to keep it relevant since that'll be officially released soon. Zedux Pros
Jotai Pros
So When Should You Use Which?I'd say this is 90% preference. The only scenario where one approach wins outright is ours, the one that prompted the creation of Zedux: Fintech apps with multiple windows, sockets, or just lots of moving data will very possibly be unable to use Jotai. Zedux is made for apps like this. Beyond that, the true best choice depends on too many factors and the outcome is too close to call. Both are powerful tools that can handle every situation. Some REST-API-powered SPAs may find Jotai's async atoms more convenient than Zedux's manual promise forwarding. Apps that need both UI state and server cache management, especially where performance is a concern, will find Zedux's combined model more convenient and several orders of magnitude faster than using Jotai with React Query. Generally, simpler apps will probably be happier with Jotai. Zedux is a safer bet for more complex apps. I'm happy to break down pros and cons for any specific scenarios. |
Beta Was this translation helpful? Give feedback.
-
Jotai and Zedux are both atomic state libraries. I’d really like to understand the key differences between them — and in which cases one would be a better fit than the other.
Beta Was this translation helpful? Give feedback.
All reactions