以下是我的JSON响应格式。
data:[
{status: "ACTIVE", zipcode: "500019", country: "India", city: "Hyderabad"}
{status: "ACTIVE", zipcode: "500026", country: "India", city: "Hyderabad"}
{status: "ACTIVE", zipcode: "500028", country: "India", city: "Hyderabad"}
]
我尝试了以下代码,但徒劳无功,我没有找到预期的结果。 我收到以下错误 应该进行赋值或函数调用,而是看到一个表达式no-unused-expressions
{this.props.bkList && this.props.bkList['data'] && this.props.bkList['data'].map(row=>{
return(
<TableRow key={row.bankId}
hover
onClick={() => this.handleViewDetail(row.bankId)}
>
{Object.keys(row).forEach(function (key){
console.log(row[key]);
<TableCell>{row[key]}</TableCell>
})}
<TableCell>
<Button variant="contained" className={classes.button} onClick={(e)=>this.handleViewBranches(row.bankCode,e)}>
View
</Button>
</TableCell>
</TableRow>
)
})}
</TableBody>
有人可以让我知道我要去哪里错吗?