100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Redux

IntermediateTool5.2K learners

Redux is a predictable state-management library for JavaScript apps that stores all application state in a single, read-only store and updates it only through dispatched actions handled by pure reducer functions.

Definition

Redux is a predictable state-management library for JavaScript apps that stores all application state in a single, read-only store and updates it only through dispatched actions handled by pure reducer functions.

Overview

Redux was created by Dan Abramov and Andrew Clark in 2015, drawing on the Flux architecture pattern and the Elm language, and it became the de facto standard for managing complex, shared state in large React applications. In Redux, the entire application state lives in one store. Components dispatch plain-object "actions" describing what happened, and pure "reducer" functions take the current state plus an action and return a new state without mutating the original — this makes every state change traceable, testable, and compatible with time-travel debugging in the Redux DevTools. Middleware such as Redux Thunk or Redux Saga handles asynchronous logic like API calls, often written with TypeScript for typed actions and state. Redux Toolkit (RTK), released in 2019, is now the recommended way to write Redux: it cuts boilerplate with helpers like createSlice, bakes in Immer for immutable-feeling updates, and adds RTK Query for data fetching and caching. Redux remains common in large, established React codebases via React.js, even as many newer apps reach for lighter alternatives such as React Query, Zustand, or the built-in Context API for simpler state needs.

Key Features

  • Single, centralized, immutable store for the entire application state
  • Pure reducer functions that make state transitions predictable and testable
  • Unidirectional data flow: action, then reducer, then new state, then UI update
  • Time-travel debugging via Redux DevTools
  • Middleware ecosystem (Thunk, Saga) for handling asynchronous logic
  • Redux Toolkit (RTK) reduces boilerplate with createSlice and adds RTK Query

Use Cases

Large single-page apps with complex, shared state across many components
Applications needing time-travel debugging or strict state auditability
Apps with heavy server-data caching and normalization needs, via RTK Query
Multi-team codebases that benefit from a strict, predictable state pattern
Undo/redo functionality built on top of action history
Cross-cutting state such as auth, theme, and notifications shared across a React app

Frequently Asked Questions