React 获取真实Dom v8.6.2版本
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>React-props</title> <script src="../common/react.js"></script> <script src="../common/react-dom.js"></script> <script src="http://cdn.bootcss.com/babel-core/5.8.38/browser.min.js"></script> </head> <body> <div id="demo"></div> <script type="text/babel"> /*生命周期(挂载阶段,更新阶段,销毁阶段)*/ let MyForm = React.createClass({ handleChange: function () { let inputvalue = ReactDOM.findDOMNode(this.refs.gqiaox).value console.log(inputvalue) }, render: function () { return ( <form > <input type="text" onChange={this.handleChange} ref="gqiaox" defaultValue="jspang"/> </form> ) } }) ReactDOM.render( <MyForm/>, document.getElementById("demo") ); </script> </body> </html>