useRef Hook
useRef returns a stable mutable box ({ current }) that persists across renders without ever triggering one when written — the escape hatch for DOM nodes, timer ids, and previous-value tracking. Reading or writing ref.current during render breaks render purity; do it in effects and event handlers.
This Concept is waiting for its first lesson!
useRef returns a stable mutable box ({ current }) that persists across renders without ever triggering one when written — the escape hatch for DOM nodes, timer ids, and previous-value tracking. Reading or writing ref.current during render breaks render purity; do it in effects and event handlers.
Are you a teacher? Sign in to start contributing.
Sign In