Open xuyingjie opened 8 years ago
http://facebook.github.io/react/blog/2015/10/07/react-v0.14.html
var React = require('react'); var ReactDOM = require('react-dom'); var MyComponent = React.createClass({ render: function() { return <div>Hello World</div>; } }); ReactDOM.render(<MyComponent />, node);
var Zoo = React.createClass({ render: function() { return <div>Giraffe name: <input ref="giraffe" /></div>; }, showName: function() { // Previously: var input = this.refs.giraffe.getDOMNode(); var input = this.refs.giraffe; alert(input.value); } });
http://facebook.github.io/react/blog/2015/10/07/react-v0.14.html