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.
SubscribeRelated
useStateuseImperativeHandleref attributeref callbackManipulating the DOM with Refs