1
刚开始看reactjsx并尝试检查一个数组(this.state.content)是否为未定义和长度> 0。这是渲染方法的一部分:如何检查reactjsx中的条件?
display = (
<section>
{
if (this.state.content.length >0)
{
this.state.content.map((item, i) => {
return <CardRenderer addPacks={true} key={i} container={item}/>
})
}
}
</section>
)
然而,这并不工作,我怎样才能在jsx中首先检查这个arraylength?