← All notes

React refs and useRef

Answer: When you want a component to "remember" some information, but you don't want that information to trigger new renders, you can use a ref. useRef is a React Hook that lets you reference a value that's not needed for rendering. (S1, S2)

How a ref behaves

Rules

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), Referencing Values with Refs – React, CC BY 4.0 (reactjs/react.dev LICENSE-DOCS); React docs (react.dev), useRef – React, CC BY 4.0 (reactjs/react.dev LICENSE-DOCS).

Cite this

Permanent ID: iil:note:t2nr1a4a

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

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