DEV Community

Discussion on: What's your go to state management library these days?

Collapse
 
danieltott profile image
Dan Ott

I am a HUGE believer in react-query - it handles 99% of the nonsense we used to try to pump into redux. So - for request data, react-query for sure.

After that, it would take a lot for me to use something other than useState or useReducer for state, and useContext if I really need to.

I try to keep state as local as it can be, and that serves me very well most of the time.

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

According to your comment and if I did not get you wrong... You should learn about Reducer Design Pattern which is just what Redux does strictly, so you can understand why it works this way. Also I can understand that Redux works with functional programming paradigm and can be a hard pill to swallow for people not used to it.
The only thing I can say in counter of Redux from an engineering point of view is that it could be less verbose tbh.

Trying to handle a supposedly unified global state as local state is just counter productive and goes against the pattern you're using. So either you didn't understand how it works and why or you understand it but you can't discern whether to use it or not.
There's no tech, design pattern, paradigm or a single thing to rule them all, each tool must be used when it covers the needs.

Also I must add to this comment a very important statement You might not need redux , and you can read the article from one of the team members that developed Redux itself. This can be applied to any of these libs to solve state management.

Things need to be analysed before applying them, otherwise science is left aside and we only obtain the technical part, which is precisely the one that must apply the results of science-based engineering which results in a blind following of things that people involved don't even understand.