我在我的jsx中有这个
<tr>
{!isEmpty(content) && content.map(o => {
if(o.sortKey){ console.log(this.state[`order${o.sortKey}`]) }
})}
</tr>
我无法运行应用程序,当我评论console.log行并执行此操作而不是console.log(this.state); console.log(o.sortKey)
,我有{ordercreated_at:'asc'}
和created_at
,但为什么我的计算状态有空错误?
content.map (o => { return (<span></span>)})
这里在map方法中返回一些东西,错误就会消失。