← React Intermediate Questions - Set 11 Q107

How does the `useRef` hook work?

React Intermediate Questions - Set 11

Example

const id = useRef(0);
id.current += 1;          // persists, no render
const box = useRef(null); // points at a DOM node

What to notice

← Back to the question list