How to get element reference without using refs in react?

Posted by Andre Scott | Updated on

Want to get element reference without using refs in react? Only string refs are considered for deprecation, you can still use callback refs:

Or in your case, you don’t need a ref, just get the DOM node from the component this, using ReactDOM.findDOMNode (demo):


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers