DEV Community

Discussion on: Need help with useRef in React !

Collapse
 
jeevankishore profile image
Jeevan Kishore

There are two use cases of useRef :

  1. Retain data across multiple rerender of the component

  2. Get reference to the DOM element / tag within the component

The above values are accessed using .current of the value.

Collapse
 
fralainbk profile image
Franck Binde

Thank you for that ! Much appreciated !