【发布时间】:2017-05-01 07:50:47
【问题描述】:
我未能使用 lodash 的地图渲染 jxs。我的渲染方法中有这个
return (
<div>
{map(groupedByMonths, (obj, index) =>
<div className="panel">
<div className="panel-heading">
{obj}
</div>
<div>{obj.price}</div>
</div>)}
</div>
)
但我得到了Objects are not valid as a React child 的错误groupedByMonths 结构看起来像这样
{
"April": [
{
"price": 0,
},
{
"price": 12
},
{
"price": 200
}
]
}
【问题讨论】:
-
@radix 如何显示“四月”?
标签: javascript reactjs lodash