We use Preact at Forem, the software that powers dev.to, but we do not use a state management library, just good old component state.
The last state management library I used was Redux back in Fall of 2018. If you require a state management library for your project, I'm curious which one do you use? Zustand, Redux, Recoil etc. or is it something more like React Query these days?
Also, what do you like/dislike about the state management library you use?
Go!
Photo by Alfons Morales on Unsplash
Latest comments (26)
Redux as always. RTK
I have used Redux for a while, and I am still using it in complex applications.
I am starting giving a change to recoil, and first experience is going so far. I really like the hooks approach to access and modify the global state.
Zustand is the go to state management library for me these days. No need to wrap your component under a Provider.
Since there are multiple types of state you would consider choosing the best tool for the problem you are trying to solve.
Here is a brief summary of state types and when to choose which tool:
github.com/alan2207/bulletproof-re...
I am using Redux from past 5 months
there is very nice tool i use to manage state , it is actually very easy tool
Overmind
check it is docs
overmindjs.org/quickstart
react-query almost always in my case. If the project is big enough and/or has big state changes Redux is a good choice especially because of the amazing debugging tools.
Zustand all the way
Effector is my absolute best now.
I never got to the point where I really need a state management library. The valid use cases would be complex application such as e-commerce website, admin control panel, interactive e-learning system and more.
I don't really consider things like React Query or useSWR to be a complete state management library. They are more like library for simple fetching without headache.
Applications that are not complex would just need to handle input, processing, output and error. For example, a blog needs to fetch data from server then display content to users, a simple chat application would handling messages from other people and sending messages from the user. If the application is this simple, it would not need complex state management solution. At most, it may require some basic solution such as Context, useState, or useReducer.