liveBook · Manning

Redux

As explained in React in Depth

Redux is a predictable state container that manages application state through dispatched actions and pure reducers.

Redux is a predictable state container for managing application data through a store, dispatched actions, and reducers. It suits complex or shared state, but classic Redux carries substantial boilerplate; Redux Toolkit (RTK) reduces that cost. section 8.0 section 8.5

The core architecture organizes state management around a repeatable cycle:

  • Keep application state in a store divided into related slices. section 8.5.1
  • Dispatch actions from action creators in response to user interaction. section 8.5.1
  • Pass actions and previous state to reducers, then update the store with the reduced state. section 8.5.1
  • Read state with useSelector and update it with useDispatch through Redux’s built-in provider. section 8.5.1

A data slice

A data slice can group related reducers, actions, and action creators. In RTK, defining an increment reducer also produces an increment() action creator, compressing several classic Redux definitions into one implementation. section 8.5.1

Figure 8.15 The simplified Redux cycle. State is kept in the store. The state defines how the application is rendered. When the user interacts with the application, actions are dispatched, and the store sends them to the relevant reducer along with the old state. The newly reduced state is updated in the store and sent back to the application, and the cycle repeats.
figure

Trace the Redux cycle from rendered state through dispatched actions and reducers back to updated store state. section 8.5.1

How React in Depth covers it

How deep it goes
Explains the store-action-reducer cycle, slices, providers, and hooks, while deferring detailed classic configuration and implementation.
Examples
Uses data, UI, and authentication slices plus an increment reducer to illustrate organization and action creation.
What it assumes
Builds on familiarity with React hooks, especially useReducer, while avoiding a requirement to create custom context.
What you can do after
Apply Redux Toolkit to build a more compact Redux data layer using slices, reducers, actions, a provider, and selector hooks.
How it connects
Connects Redux with React context, useReducer, useContextSelector, Redux Toolkit, and Zustand.

Also explained in

Compare how 2 books explain Redux →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of React in Depth. The section links point to the parts of the book it draws on.