Warning: Each child in a list should have a unique "key" prop. Check the render method of `Body`...

昨天在Ant desgin pro开发新建一个列表页面遇到警告错误:Warning: Each child in a list should have a unique "key" prop. Check the render method of Body. See https://reactjs.org/link/warning-keys for more information.

找了大半天,各种render的key都差异化设置完了,还是会出现,让人头疼的很。后来去对比了其他页面时,发现少了rowKey设置,原来:


后来改为这样就好了(前提是你的列表每项数据里必须有id字段):


你可能感兴趣的:(Warning: Each child in a list should have a unique "key" prop. Check the render method of `Body`...)