react异常 Each child in a list should have a unique “key” prop
react异常警告:Each child in a list should have a unique “key” prop
原因:Dom在渲染数组时,需要一个key,不然嵌套数组时会引起歧义
解决:
{
title:"customField",
dataIndex:"customField",
key:"customField",
render:(text,record) => {
return record.userCustomField.map(item,index) =>{
return(
<div key={index}>
<Text delete={!record.enable}>{item.customFieldName}</Text>
</div>
)
}
}