javascript - React.findDOMNode(component) list of methods - Stack Overflow

I know there is React.findDOMNode(ponent).valuefocus(). I am looking for all the methods can be used w

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.

Share Improve this question edited Aug 25, 2015 at 9:34 Chris Martin 30.8k12 gold badges80 silver badges141 bronze badges asked Aug 25, 2015 at 9:22 Amon BazongoAmon Bazongo 2954 silver badges12 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

React.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 returns null or false, findDOMNode returns null.

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

相关推荐

  • javascript - React.findDOMNode(component) list of methods - Stack Overflow

    I know there is React.findDOMNode(ponent).valuefocus(). I am looking for all the methods can be used w

    7小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信