React.createClass({});
getInitialState,this.setState({});
{}解读代码块,外层不要加引号,比如onChange={this.handleChange}
ReactDOM.render(,ele);
ref=‘a‘,获取dom真实节点
1 var usernameDOM = this.refs.username.getDOMNode(); 2 var usernameDOM = React.findDOMNode(this.refs.username); 3 var usernameDOM = this.refs[‘username‘].getDOMNode(); 4 var usernameDOM = React.findDOMNode(this.refs[‘username‘]);
时间: 2024-10-03 13:19:42