when attaching a ref to a DOM component like <div/>,you get the DOM node back;
when attaching a ref to a composite component like <TextInput />, you will get the React class instance.
In the latter case, you can call methods on that component if any are exposed in its class definition.
1、ref添加到component上获取的是component实例,添加到原生HTML上获取的是DOM 官方原文:
PS:新版本的React已经不推荐使用ref string,最好使用ref callback 2、ReactDOM.findDOMNode,当参数是DOM,返回值就是该DOM(这个没啥用);当参数是Component获取的是该Component render方法中的DOM 3、区别: refs从组件内部获取组件内部的DOM;ReactDOM.findDOMNode从组件外获取组件渲染的DOM。 refs可以拿子组件的props/state/方法;findDOMNOde拿到的是原生的标签相关属性。