React — Interview Questions & Mental Models
Refs (useRef)
- .current persists across renders without causing re-renders when mutated.
- Use for: DOM nodes, timer ids, any mutable value that shouldn't trigger render.
- Don't read/write ref.current during render for things that affect output — that's state territory.