求教:ReactDOM.render()返回的是什么?

#1

官方文档里的一段话:
Not to be confused with the render() function that you define on your component (and which returns a virtual DOM element), ReactDOM.render() will return a reference to your component’s backing instance (or null for stateless components).
这里的ReactDOM.render()返回的是什么的引用? backing instance指什么?
还有,我在componentDidMount方法里面根据this.refs.__获取到的自定义组件,怎么样才能取到它的真实dom节点属性。对于一般的标签如input是可以直接取到的,但是自定义组件直接取不到。

试了一下直接打印,打印出的 ReactDOM.render() 和componentDidMount方法获取到的自定义组件是一种类型的。

#2

返回的是render的Component的实例

const div = document.createElement('div');
document.body.appendChild(div);
const container = ReactDOM.render(<Container />, div);

// static method ======================================================

function close (id) {
  container.removeModal(id);
};

function open (options) {
  container.addModal(options);
};
#3

恩 看了一下文档 明白了

下边这两个方法是什么,是放在组件中的吗?
removeModal和addModal是组件实例的方法吗?

#4

用findDOMNode来获取react组件的真实DOM元素,render返回的是React.createElement类创建的实例对象

#5

对 知道了

#6

嗯,是组件的实例方法