得到例外
"不变违规:预期onMountComponent()在孩子将其包含在onSetChildren()中之前为其触发"
将一个组件称为另一个组件
const Forms = this.props.Forms.map(Form=> {
return(
<table className ="tableN table table-striped table-bordered" key = {Form.get('uid')}>
<thead style={{fontSize:'9pt'}}>
<tr>
<td>
Subject:
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<label>Form details:</label>
<SomeForm Form={Form}/>
</td>
</tr>
</tbody>
</table>
)
})
Run Code Online (Sandbox Code Playgroud)
SomeForm是另一个组件可能导致此错误的原因???
是否有更好(更好)的方式来编写这个if语句?
Array a =null, b= null, c= null, d= null;
if(a!=null && b!=null && c!=null && d!=null)
{ //// TODO }
Run Code Online (Sandbox Code Playgroud)