The biggest advantage is, state managements are global, meaning if you have many component/page in your project you can access the states from any components easily. On the other hand if you use normal useState hook, you need drill your prop. Also using zustand gives you the easy ability to keep the user preference in localStorage.
Hope this helps
The biggest advantage is, state managements are global, meaning if you have many component/page in your project you can access the states from any components easily. On the other hand if you use normal useState hook, you need drill your prop. Also using zustand gives you the easy ability to keep the user preference in localStorage.
Hope this helps
But if we create our state inside a custom hook then we don't need prop drilling right ?
Correct! thats another way of doing it.
But in my opinion, zustand is much more easy to deal with also, easy to manage the state in the localStorage.