DEV Community

Vishnu Priya S
Vishnu Priya S

Posted on

useRef hook

You can directly access the DOM node once it mounts. this manages the focus , text selection in input box

Mutable values: Here you can hold data or the previous state values update the value with ref.current changes the value without re-render the component.

-> this manages the .focus() , text selection in input box

eg: when you had a input box and you wanted to enter your name so you click the input box when you use focus that help to write the name without clicking the input field.

Top comments (0)