Cover image by Josh Weirick on Unsplash.
Hey! 👋
If you're a Front-end developer or aspiring to become one, I am sure you might have come across R...
For further actions, you may consider blocking this person and/or reporting abuse
Hi, I'm a Redux maintainer. The good news is this post does a good job of covering some of the basics of Redux. However, "modern Redux" is very different from what's shown in this tutorial. Today we teach using our official Redux Toolkit package to write your 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. Unfortunately, most tutorials online are out of date and show practices that result in a lot of extra code being written.
For details on using Redux Toolkit (and the React-Redux hooks API), see our official Redux docs pages:
Hey Mark!
Yes, I am aware of it. I will write a detailed explanation on Redux toolkit as well. Infact. that's what I use for my side projects now a days. :)
The intention of this post was to help people know that a lot of stuff is not that hard. And some jobs like mine still use the old way, so it will help.
This article is more for me than others, actually. By writing I can remember concepts, which might be helpful in some other areas. Also, reading and exploring satisfies my hunger to learn more.
Apart from this, I deep dived into Redux after interacting with you on Reddit. We had a short chat about ContextAPI vs Redux. :)
Gotcha :) This is a well-written article, btw - just want to make sure others are aware that RTK exists since the article didn't mention it
Fair point! Added a link to the Redux toolkit in the end.
I have to admit redux toolkit is amazing, as it adresses redux's biggest problem : BOILERPLATE
But, in my opinion, it would be very useful for someone to work on redux before toolkit, in order to better understand the underlying technology.
This way she/he will appreciate redux toolkit's offerings even more!
Totally agree on this! When I first started to learn Redux, I decided to begin a series on this having exactly that in mind: Looking under the hood before using any abstractions.
For anyone interested it's here: Real-time app using React, Redux, Tailwind CSS & Firebase - Part 1
Yes! Totally in favour of this.
RTK would be appreciated more if people know about old way doing things in Redux.
FWIW, that's why we have two different tutorials in our docs:
I want to take the opportunity to thank you guys for the toolkit!! I love using it with react. Cheers to you all!!
Here's the
zustand
version of the counterWhy go hard on yourself when life can be so easy!
About the same amount of code as modern Redux. This article just shows the internals, not how it is really used nowadays. For modern Redux, I'd recommend
redux.js.org/tutorials/essentials/...
Nice and complete cover of pure redux!! 🎉 Congrats.
I think it's essential to understand this way of using redux before going to use the toolkit, it lets you understand better what the toolkit will do (and lets you create a deep appreciation for how it makes things simple 😁😁).
Btw, i just didn't understand your statement of ""I found that 80-90% of the things we do in Redux is just plain JS.""... it is 100% pure JS in this form. You can implement it anywhere.😉
Agreed! 🙌 and I'm glad you liked it.
Haha! yeah. It's all JS anyway. 😁
Thanks for this article. It makes easier to understand what the redux is about. I tried Redux 3 or 4 years ago and it was a horrible experience. I was super new to React/Redux and JavaScript and I had to deal with A LOT of boilerplates. I was pretty much traumatized by it. But after gaining more experiences with React and JS and with the latest Redux, I think I can try again. It makes more sense now.
Wow! Feels good to hear that.
I'm glad I could help. 😇
Thankyou loved this article
I do suggest please add another article that discuss redux toolkit basics like this article did
Glad you liked it!
Yes, for sure, I'll try to add it soon. :)
Hola Sanjeev!
Están bastante didácticas las explicaciones de esta guía.
Se entiende y se sigue sin dificultad.
He leído muchos Tutoriales de Redux y este es el más entendible.
Muchas gracias.
Saludos.
PD: Quedo atento a tu POST sobre React Toolkit.
Gracias por estas maravillosas palabras, amigo! 🙌
Thank you
😇😇
Excellent tutorial!!
Thanks! :)
Is there any way to use redux in html,css,js code not react or webpack?
Absolutely, check this link on official redux documentation.