𝐑𝐄𝐃𝐔𝐗 𝐎𝐑 𝐙𝐔𝐒𝐓𝐀𝐍𝐃 ?
As a React developer, I have been trying to compare Redux with Zustand . I started my React dev journey with Redux, but along the line, I met Zustand! At first, I thought it would be weird taking Zustand on, but it turned out to be great!
Redux has quite a lot of boilerplate code and requires setting up different 'departments', in terms of actions, reducers, combine-reducers etc ....giving some sort of decentralized vibe. The redux logic flow also involves 'funny' patterns like importing an action, not using it yet, passing it into the connect binder which returns a 'prop action' possessing affiliation with the store, that your component actually uses!
Zustand on the other hand, puts all these 'departments' into one file and uses react hooks, hence is preferably used with function based components.
At first, I still wasn't impressed after having a look at the simplicity of Zustand. I still thought about the react-redux connect binder which lets React components see the redux props as 'part of its state' (prolly in a secondary manner) hence inducing a re-render...hot reload! Well, recently I think I've seen a way Zustand can support that !
So yeah, though Redux might have some in-built advanced features like time-travel debugging, Zustand might just be all you need! Still have a thing for Redux though.
Top comments (0)