I started using React in its early days when class components where the norm. There was setState()
for local state and nothing for global state β no functional components, no useState()
or useContext
.
Redux soon came forth as the industry standard for global state. Almost every React tutorial or course included Redux as part of its program where you had to learn both to build anything beyond a counter app.
There was much to love about Redux with its flux pattern, immutable state, time-travelling debugging, etc. I tried using it but ended up drowning in boilerplate code. There was so much code to write to get anything working β reducers, action creators, thunks, sagas, where does it stop...
I hopped from one state management solution to another to avoid using Redux. Until now...
Fast forward to a few days ago when I came across a Learn from Jason video where the awesome Mark Erikson walked through building a dog breed fetching app with the new Redux (Redux Toolkit).
Turns out that Redux has a new opinionated state management library to make handling global state in React a breeze. Basically all the great parts of Redux without the boilerplate and it is amazing!
I coded along with Jason and fell in love immediately. It is so intuitive and takes the pain out of wiring up predictable state for your app.
If you used to hate Redux like me and tried to avoid it at all cost, I encourage you to take a second look at this new modern Redux. You will be pleasantly surprised.
Check out the app I built and its code on GitHub
Top comments (0)