The current property, written .current, is the mutable value stored on a useRef return object. Read it to retrieve the retained value and assign it to update that value without triggering a re-render. section 7.1.3
Track the last click without rendering
const lastClickTime = useRef(null); const onClick = () => { const isDoubleClick = Date.now() - lastClickTime.current < THRESHOLD; if (isDoubleClick) { setCounter((value) => value + 1); } else { lastClickTime.current = Date.now(); } }; Use .current for internal values such as the previous click time when changing the value should not update the JSX.
Figure 7.2 This time, if the user clicks the button the first time, the last click time is recorded, but it doesn’t cause a re-render because it’s not an active state value, but a passive one. This means that we can still access the value later (on this or future renders), but it doesn’t cause a new render by itself.
Shows how a value remains available on later renders while updating it does not independently trigger a new render. section 7.1.3

