A ref’s current property stores its mutable, current value. useRef initializes it once, then returns the same ref object across renders. section 5.1.2
Use the current property when a value must persist without driving the rendered UI:
- Assign timer IDs to current so effects and event handlers can cancel active timers without triggering a re-render. section 5.2
- Let React place DOM element references in current, then use those elements for actions such as focusing a field or reading an uncontrolled input. section 5.3
Persisting a timer ID
const timerRef = useRef(null);\ntimerRef.current = setInterval(() => {\n dispatch({ type: "NEXT_BOOKABLE" });\n}, 3000);\n\nfunction stopPresentation() {\n window.clearInterval(timerRef.current);\n} section 5.2
const ref = useRef(1);
See the minimal useRef call that creates an object with a current property. section 5.1.2

