Why I NEVER Use Redux in 2025
26/03/2025Saul Vo
Redux has long been a staple in the React ecosystem, but in 2025, I never use it. While it remains a valuable skill for job applications, for personal and most professional projects, it's overkill. Let me take you through a simple comparison between Redux and the Context API to illustrate why.
The Overhead of Redux
I built a simple Next.js app that implements both Redux and Context API to achieve the same result. At first glance, they might seem similar, as both require wrapping the app in a provider:
- Redux: Requires a single
Provider
for the entire app. - Context API: Requires multiple providers if using different contexts (e.g., AuthContext, UserContext). This might lead to provider nesting, but it's manageable.
The Complexity of Redux Setup
The Redux setup requires a significant amount of boilerplate code:
- Creating the Store: The Redux store must be configured and wrapped in a provider, ensuring it runs on the client side.
- Creating Slices: Each state slice requires its own separate file with
createSlice
, definingreducers
,initialState
, and actions. - Using Redux in Components:
- Use
useSelector
to access state. - Use
useDispatch
to modify state. - Import multiple utilities for even basic interactions.
- Use
This is a lot of unnecessary complexity just to manage state.
The Simplicity of Context API
On the other hand, Context API keeps things minimal and straightforward:
- State Management: Uses built-in React
useState
, making it easy to understand and modify. - Single File Management: A context provider can be written in one file, making organization much simpler.
- Custom Hook for Ease:
- A custom hook like
useGlobalState
makes accessing and modifying state intuitive. - No need to import multiple utilities—just call
useGlobalState
and access your data directly.
- A custom hook like
Real-World Example: A Shopping Cart
I use Context API in production applications, such as a shopping cart provider. This provider manages:
- Cart state
- Add to cart / remove from cart functions
- Local storage synchronization
- Custom hook for easy access (
useCart
)
This setup is concise, maintainable, and relies solely on core React features—no extra libraries required.
Why I Stopped Using Redux
- Too much boilerplate: Setting up Redux requires multiple files and abstract concepts that increase complexity unnecessarily.
- Slower development: Importing multiple utilities (
useSelector
,useDispatch
, action creators, reducers) slows down coding and debugging. - Unnecessary abstraction: Redux introduces additional layers that often aren't needed for most applications.
- Context API is enough: For 99% of use cases, Context API, combined with
useState
oruseReducer
, provides everything you need with minimal setup.
Conclusion
If you're applying for jobs, knowing Redux is beneficial. However, for personal and production projects, I never use Redux. Context API, with custom hooks, provides a much simpler, maintainable, and efficient way to manage state. Redux had its time, but in 2025, it's largely unnecessary.