Disclaimer: This article is specifically regarding the use of Redux within React (via
react-redux). Although I think many of Redux's issues apply in all of its use cases, this critique will be focused on its use within React.
About Me: I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at Better Coding Academy, and as part of what I do, I post videos on our YouTube channel at https://www.youtube.com/c/BetterCodingAcademy.
(Subscribe for awesome web development content!)
I recently asked the DEV community to provide me with code to review, and this is the last episode in this series!
Anyways, on to Redux.
- Create 5 different files and write 100 lines of code.
- Set up actions and bindings within your components.
- Ensure that everything works as expected by using Redux DevTools, because you can't even understand what exactly is going on in all 500 of your redux-connected components.
This is what it is like every single time I add something to a Redux store. The problem only gets exacerbated the larger the app gets, and the more reliant the app is on Redux and its middleware (e.g. Redux Thunk or Redux Saga).
It seems that for the majority of use cases, the Redux-based implementation is not the best solution out there.
Instead of generalised global state, consider using local state (e.g. component state or the
useState hook). Alternatively, consider using the once again built-in
In this video, I review a project that uses (in my opinion) too much Redux, and explain how it can be better written without using as much Redux.
- I am a professional React developer, and I recently performed a code review of a stranger's code. Here's what I got.
- You should stop using Create React App.
- This is how you refactor a React app.