
您不应该将组件子d放在花括号中:
var Hello = React.createClass({ render: function() { return <this.props.component.slug className='text'> {this.props.component.value} </this.props.component.slug>; }});React.renderComponent(<Hello component={{slug:React.DOM.div, value:'This is my header'}} />, document.body);这是一个有效的小提琴:http :
//jsfiddle.net/kb3gN/6668/
此外,您还可以找到JSX编译器,有助于调试此类错误:http : //facebook.github.io/react/jsx-
compiler.html
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)