Back

Fix useRef Not Persisting Across Re-renders

Problem

useRef value is reset on re-render because ref object is recreated.

Code Editor