Skip to content
masterclass Buddy

React 19+ · Type Alias

Ref

useRef stores a value in a stable object without causing re-renders when the value changes. It is useful for non-visual data, such as timer IDs, and for accessing DOM nodes.

Last updated

Syntax

const ref = useRef(initialValue)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • useState
  • useImperativeHandle
  • ref attribute
  • ref callback
  • Manipulating the DOM with Refs

Source: useRef – React. Checked 2026-11-03.