How to get the real DOM node by react.js
This article mainly introduces "how to get real DOM nodes from react.js". In daily operation, I believe many people have doubts about how to get real DOM nodes from react.js. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how to get real DOM nodes by react.js". Next, please follow the editor to study!
To get the real dom node, the text input box must have a ref attribute, and then this.refs. [refName] will return the real DOM node.
Var MyComponent = React.createClass ({handleClick: function () {this.refs.myTextInput.focus ();}, render: function () {return ();}}); ReactDOM.render (, document.getElementById ('example')); at this point, the study of "how react.js gets real DOM nodes" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!