报错总结
antd key报错 Each child in a list should have a unique “key“ prop.
Warning: Each child in a list should have a unique “key” prop. Check the render method of
Body
.
解决方式:官方给 Table 组件提供了一个 rowKey 属性,用于给表格的每一行设定一个 key 值 在 antd 官方文档底下也有相关解决办法:https://ant-design.gitee.io/components/table-cn/#API
<Table
{/* 在组件增加这一行 这里id具体为数据的唯一值 */}
rowKey={r => r.id}
/>