admin管理员组文章数量:1421483
I know there is React.findDOMNode(ponent).value/focus()
. I am looking for all the methods can be used with React.findDOMNode
.
For example, I have an <input type='checkbox' ref='ponent' />
tag, and I tried React.findDOMNode(this.refsponent).selected
(I dont know if it exists), and there is nothing.
I know there is React.findDOMNode(ponent).value/focus()
. I am looking for all the methods can be used with React.findDOMNode
.
For example, I have an <input type='checkbox' ref='ponent' />
tag, and I tried React.findDOMNode(this.refs.ponent).selected
(I dont know if it exists), and there is nothing.
2 Answers
Reset to default 4React.findDOMNode
is described by the Top-Level API documentation:
DOMElement findDOMNode(ReactComponent ponent)
If this ponent has been mounted into the DOM, this returns the corresponding native browser DOM element. This method is useful for reading values out of the DOM, such as form field values and performing DOM measurements. When
render
returnsnull
orfalse
,findDOMNode
returnsnull
.
The value returned is a native DOM element—not a React-specific type, which is why it's not covered by the React documentation.
You can always assign an event and use event.currentTarget.value
本文标签: javascriptReactfindDOMNode(component) list of methodsStack Overflow
版权声明:本文标题:javascript - React.findDOMNode(component) list of methods - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745352086a2654829.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论