+ 2
What is useRef Hook in React ?
Some one tell me what is the use of useRef hook
1 Answer
+ 5
There are two main uses of useRef that are explained in the following sections: Accessing the DOM nodes or React elements and keeping a mutable variable.
Here is an example of useRef accessing an input element
https://code.sololearn.com/WvBFZ059AhjL/?ref=app
Here is an example of useRef as mutable variable.
https://code.sololearn.com/WW9Q8vDDfa0q/?ref=app