useRef()
Use useRef() to get a hold of DOM elements created by the component.
There are two parts to retrieving a DOM element reference:
useRef()returns arefobject that contains acurrentproperty which will eventually contain the reference.ref={_ref_variable_}is a prop binding that will set thecurrentproperty of therefobject to the DOM element.
Example
The example on the right uses useRef() to get a reference to the input element. However, it is missing the ref prop binding. Add the ref prop binding to make the example work as expected