The following small series will bring you a react. js to get the real DOM node. I think this is quite good. Now I will share it with you and give you a reference. Let's take a look at the following small series to bring you a react. js to get the real DOM node. I think this is quite good. Now I will share it with you and give you a reference. Let's take a look at it with xiaobian.
To obtain a real dom node, the text input box must have a ref attribute. Then this. refs. [refName] returns this real DOM node.
Var MyComponent = React. createClass ({handleClick: function () {this. refs. myTextInput. focus () ;}, render: function () {return () ;}}); ReactDOM. render (
, Document. getElementById ('example '));
The above describes how to use react. js to obtain details of real DOM nodes. For more information, see other related articles in the first PHP community!