ref

原文链接 : https://www.jianshu.com/p/8e7b4df6fcc2

在react 中操作真实的dom 元素 ,可以到 ref(refrence) 属性,它既可以用在 react 的组件 上,即获取的是组件的实例,获取实例的dom 节点,可以用 ReactDom.findDOMNode( refs ) 也可以用在 html元素上,即获取的是dom节点。

Last updated

Was this helpful?