Videos
Β» npm install zustand
My background:
-
I am a Software Engineer but I don't work on web services as part of my job and definitely not on UI.
-
I have a small (40k LOC, few hundred users a week) personal project built with React (SPA, no framework).
Currently I am using the built-in `useState` and `useContext` and it's mostly doing what I want it to do. I have seen a lot of raving about Zustand so I just installed it and played around with it but I'm not 100% sure what I actually should be using it for.
My current understanding is Zustand helps manage global state more efficiently and maybe slightly more conveniently than Context does, but I don't have that much global state in my app anyways and even with my testing on lower end mobile devices I don't have any big problems with performance related to modifying my global state anyways. (And actually when I switched over to Zustand to play around I noticed an odd rendering issue introduced when modifying my global state that was definitely not there before).
Is this something that really shines in larger apps? Or maybe there's more global state in other domains that is not really a factor in my project, so I don't see the benefit?