Vitamin
Vitamin copied to clipboard
would you guys be willing to add a state management library like Redux
Hi, would you guys be willing to add a state management library like Redux? I'm currently trying to do this, but I'm still new to React, so I don't know what's the best practice to add it...
Hi @ZhengjieYe! Thanks for your interest in this template.
There is no state management library in this template because of React Query. It handles all the asynchronous operations between the server and the client. I recommend you to read this article: React Query and global state managers.
If you need to store some client-only state for a visual editor or an audio recorder I recommend you to use Zustand. It's much simpler and lighter than Redux. You can read a comparison here: Simplifying state management with Zustand.
I can set up an example using Zustand if you want.
That's so kind of you! Thank you!! Yeah, I think Zustand is ok for me.
Hey @ZhengjieYe, sorry for the big delay.
Unfortunately, I couldn't find a valid reason for adding a state management library to this template. You can put anything async in react-query and the rest in a Context.