DEV Community

Discussion on: Need help with useRef in React !

Collapse
 
dgiulian profile image
Diego Giuliani

The short answer is that you can use useRef when you want to persist some value in multiple renders of your component (similar to useState) but you don't want to re-render that component when that value changes.
Tyler McGinnis has one of the best explanation on how to use useRef

Collapse
 
fralainbk profile image
Franck Binde

Thank you so much! That link you've shared is very useful.