← All notes

Managing complex state with useReducer

useReducer is a React Hook that lets you add a reducer to your component. [S1]

Reducer updates

The reducer function specifies how the state gets updated from the previous state and an action. [S1]

State and action can be of any types. [S1]

You can pass an initializer function that should return the initial state. [S1]

When shared transitions grow

Sometimes, you want the state of two components to always change together. [S2]

Add state to the common parent and pass it down together with the event handlers. [S2]

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: React docs (react.dev), useReducer – React, CC BY 4.0 (reactjs/react.dev LICENSE-DOCS); React docs (react.dev), Sharing State Between Components – React, CC BY 4.0 (reactjs/react.dev LICENSE-DOCS).

Cite this

Permanent ID: iil:note:zqdevkp1

iinventedlight. 2026. "Managing complex state with useReducer." iinventedlight Library, iil:note:zqdevkp1, version of 2026-11-06. https://iinventedlight.com/library/notes/react-usereducer/. License: CC-BY-4.0.

@misc{iil_note_zqdevkp1,
  author = {{iinventedlight}},
  title = {{Managing complex state with useReducer}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-06},
  url = {https://iinventedlight.com/library/notes/react-usereducer/},
  note = {Permanent ID iil:note:zqdevkp1. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/react-usereducer.md.