0
我有以下的(我没有写):阵营格式问题
render: function() {
if(this.state.loading){
return <div><span><i className="fa fa-spinner fa-spin"></i> Loading...</span></div>
}else if(typeof this.state.listing.id == 'undefined' || !this.state.component){
return false;
}
return (
React.createElement(eval(this.state.component), {
listing: this.state.listing,
onClose: this.handleClose,
options: this.state.options
})
);
}
这是一个React.creatClass内。我是陌生的反应,但只需要一个包装DIV解决此部分:
React.createElement(eval(this.state.component), {
listing: this.state.listing,
onClose: this.handleClose,
options: this.state.options
})
如何添加围绕一块简单的div,所以我可以正常样式该组件?
'eval(this.state.component)'哇,这看起来像一个反模式。 – Mathletics