What is the use of refs in React js?

DWQA QuestionsCategory: Web Design HTMLWhat is the use of refs in React js?
Editor Staff asked 2 weeks ago

What is the use of refs in React js?

1 Answers
Editor Staff answered 2 weeks ago

The ref is used to return a reference to the element. They should be avoided in most cases, however, they can be useful when you need a direct access to the DOM element or an instance of a component.