React 19 · State and effects
Keep a mutable value or DOM node
A ref persists between renders without causing a re-render.
const inputRef = useRef<HTMLInputElement>(null);
inputRef.current?.focus();
Official React 19 documentation
React 19 · State and effects
A ref persists between renders without causing a re-render.
const inputRef = useRef<HTMLInputElement>(null);
inputRef.current?.focus();
Official React 19 documentation
Was this page helpful?