Reactjs 警告应在箭头函数末尾返回值
我在控制台上收到这个警告。然而,在我看来,代码是正确的:Reactjs 警告应在箭头函数末尾返回值,reactjs,eslint,Reactjs,Eslint,我在控制台上收到这个警告。然而,在我看来,代码是正确的: { report.report.map((item, key) => { if (item.status !== "pending_review") { return ( <div key={key}> <Spacing appearance="small"
{
report.report.map((item, key) => {
if (item.status !== "pending_review") {
return (
<div key={key}>
<Spacing appearance="small" />
<Title as="h5" >Data: {formatDate(item.createdAt)}</Title>
<Title as="h5" >Realizada por: {item?.reported_by?.users[0]?.name}</Title>
<Spacing appearance="x-small" />
<Title as="h5" >{item?.description}</Title>
<Spacing appearance="medium" />
</div>
)
}
})
}
{
report.report.map((项,键)=>{
如果(item.status!=“待定的审查”){
返回(
数据:{formatDate(item.createdAt)}
Realizada por:{item?.reported_by?.users[0]?.name}
{项目?.description}
)
}
})
}
在if
-语句之后缺少默认返回值:
{
report.report.map((项,键)=>{
如果(item.status!=“待定的审查”){
返回(
数据:{formatDate(item.createdAt)}
Realizada por:{item?.reported_by?.users[0]?.name}
{项目?.description}
)
}
返回null//