Answer the question
In order to leave comments, you need to log in
What is the difference between useRef and just taking value from input?
What is the difference between useRef and just taking value from input? And how is it better?
Answer the question
In order to leave comments, you need to log in
useRef is needed to access the tag directly, because doing something through document.get... is highly discouraged. And in general it is better to have an input state (useState) and update it on changes (onChange)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question