DEV Community

Cover image for What, Why, When Redux for state management.

What, Why, When Redux for state management.

Suraj Auwal on October 31, 2020

Redux, without saying, is the most popular state management library for React. But sometimes it comes off as intimidating to beginners, well for m...
Collapse
 
markerikson profile image
Mark Erikson • Edited

Hi, I'm a Redux maintainer. A few quick thoughts:

First, I've written articles and discussed when and why it makes sense to use Redux, as well as how Redux compares to various other tools and options:

Second, "modern Redux" is considerably different than the Redux code people might have seen in the past. In particular, we now teach people to use our official Redux Toolkit package as the standard approach for writing Redux logic. It includes utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once:

redux-toolkit.js.org

The React-Redux hooks API also makes it easier to use Redux in their React components.

Finally, we've added a "Redux Essentials" tutorial in our core docs, which teaches beginners "how to use Redux, the right way", using our latest recommended tools and practices like RTK and the React-Redux hooks:

redux.js.org/tutorials/essentials/...

I've also just published a new "Redux Fundamentals" tutorial that teaches "how Redux works, from the ground up". That tutorial is now live:

redux.js.org/tutorials/fundamental...

Collapse
 
siradji profile image
Suraj Auwal

I am honored to have a redux maintainer here. Thanks a lot for your input!

Collapse
 
cadams profile image
Chad Adams • Edited

In my opinion if you’re going to use Redux use a Redux library that reduces Reduxes boilerplate. Redux by itself has a ton of boilerplate and looks intimidating. Checkout easy-peasy.now.sh/ its amazing. Works with Redux dev tools too.

Collapse
 
alexandrudanpop profile image
Alexandru-Dan Pop

RTK - redux toolkit - will also reduce some of the boilerplate.

Collapse
 
siradji profile image
Suraj Auwal

Never heard of that. I will defo check it out. Thanks!

Collapse
 
alexandrudanpop profile image
Alexandru-Dan Pop

Nice article! I like the points mentioned here. I also wrote about this not long ago.

Collapse
 
siradji profile image
Suraj Auwal

That's one dope article! Well written.

Collapse
 
alexandrudanpop profile image
Alexandru-Dan Pop

Thanks!

Collapse
 
laszland profile image
Laszlo Roland Kiss

Thank you for the great article. To me Redux was also a kind of pain in the ass, but I fought for it. I guess the hard part to teach/learn it, that you only see the benefit of Redux in case of a complex architecture, but you learn it always on easy projects. So I was also sceptical about it, why is it good to use? The point is that this is an important topic, looking forward to seeing your tutorial. 😊

Collapse
 
siradji profile image
Suraj Auwal

I am glad you liked it.

Collapse
 
devimran profile image
Imran Shaikh

I know Redux...But using Recoil for small project.