如何将道具传递给{this.pros.child}
<Parent> <Child value="1"> <Child value="2"></Parent>
<select><option>
var Parent = React.createClass({
doSomething: function(value) {
},
render: function() {
return (<div>{this.props.children}</div>);
}});var Child = React.createClass({
onClick: function() {
this.props.doSomething(this.props.value); // doSomething is undefined
},
render: function() {
return (<div onClick={this.onClick}></div>);
}});{this.props.children}
翻阅古今
慕姐8265434
慕标琳琳
随时随地看视频慕课网APP