← All notes

React state and useState

Answer: In React, component-specific memory is called state. useState is a React Hook that lets you add a state variable to your component. (S1, S2)

Why a local variable is not enough

Using useState

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), State: A Component's Memory – React, CC BY 4.0 (reactjs/react.dev LICENSE-DOCS); React docs (react.dev), useState – React, CC BY 4.0 (reactjs/react.dev LICENSE-DOCS).

Cite this

Permanent ID: iil:note:y0qfszzm

iinventedlight. 2026. "React state and useState." iinventedlight Library, iil:note:y0qfszzm, version of 2026-11-04. https://iinventedlight.com/library/notes/react-state/. License: CC-BY-4.0.

@misc{iil_note_y0qfszzm,
  author = {{iinventedlight}},
  title = {{React state and useState}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/react-state/},
  note = {Permanent ID iil:note:y0qfszzm. 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-state.md.