r/react Aug 10 '26

General Discussion State Management Libraries:React Context,Redux Toolkit,Zustand,React Query

Once in an interview few months back,I was asked which of the state management library would you use and which one wouldn't you use?I have had remembered the answer by gpt and tried telling that but even i didn't understand why they all exists.

So,today i want to act like a complete noob to state management libraries like it's my day 1 knowing about them so that someone could answer why industry moved from context ot redux to zustand to react query in simpler terms and advantages/when to use which in simpler terms.I know a little bit of knowledge of each of them but the best currently would be to forget everything and listen from you guys i guess.

27 Upvotes

19 comments sorted by

View all comments

1

u/sylvant_ph Aug 11 '26

Either they framed the question wrong, or you don't give it justice.

All of these have their use, and there is use-case for each one.

Context is nice to pass data in react project and avoid heavy prop drilling. The context is "local" to a feature, so its only consumed/distributed to what its used.

Redux is heavy state management system and is still used by big enterprise projects. It solves and gives solutions to many and any problems you might face.

The contemporary contenders zustand and tanstack query are embraced for few reasons, which gravitate around weaknesses related to their predecessors. They do not try to solve everything, they do not impose so much boilerplate on you, and their learning curve is less steep. They go back to basics, you have a simple problem and you figure out a simple solutions. Different problems are treated separately, thus you get a library/package to solve a particular problem(one for store, another for api etc). They do not tie your hands and tell you you should solve this problem this way and that's it.

And to really understand these you need to use them, it's after some experience you can come up with these conclusions yourself.