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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745352087a4623894.html
评论列表(0条)