when we are taking the input from an input tag we may define some state for the variable or the field but it will call as you write a character which is not an optimized way beacause we are calling a function in Onchange = { }
Instead we can use the useRef hook in react to connect the input tag directly by javascript
we use
<input ref ={ inputRef } type ="text" >
inputRef=useRef(defaultvalue);
now the input tag is directly connect with the javascript
as the user provide the input we get an object inside the inputRef
we can get the value in the inputRef.current.value
ย