In Functional Components: We use useRef Hook It returns a mutable object that persists for the full lifetime of the component.
In Class Components: React.createRef(), Similar to useRef, it creates an object with a .current property.
In Class Components: Callback method, Instead of passing a ref object created by createRef, you pass a function. React will call this function with the DOM element when the component mounts, and with null when it unmounts.
We simply set the ref attribute in the <input> with a function instead of ref attribute created by useRef().
This function receives the DOM node and assigns it to the inputRef we declared before.
Since we didn't create a ref with useRef the inputRef variable stores the DOM element itself hence we don't need to access the .current property, as you can see in the onClick and onFocusClick functions.