pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG] ProCard Warning: Each child in a list should have a unique "key" prop.

Open PlayApple opened this issue 2 years ago • 3 comments

🐛 bug 描述

新建一个pro.antd的模板工程,升级所有依赖为最新。在空白页面中写<ProCard>内嵌套多个<ProCard>,会提示丢失Key

这两种写法都会提示key丢失 <PageContainer> <ProCard key="key1"> <ProCard key="key2">123123</ProCard> <ProCard key="key3">123213</ProCard> </ProCard> </PageContainer>

<PageContainer> <ProCard> <ProCard>123123</ProCard> <ProCard>123213</ProCard> </ProCard> </PageContainer> 我目前的解决办法是用Space代替父级ProCard. 另外:以前这个写法是没问题的,最近1个月发现的。具体在ProCard哪个版本我没有深入查,可能是新版中ProCard 循环中的pro-card-col-{index}失效了。

© 版本信息

@ant-design/[email protected] [email protected] @umijs/[email protected]

screenshot-20220914-115141

PlayApple avatar Sep 14 '22 03:09 PlayApple

以下的 Issues 可能会帮助到你 / The following issues may help you

  • [#2659][🐛[BUG] ProCard 嵌套报错警告 Each child in a list should have a unique "key" prop.][90%]
  • [#2428][🐛[BUG]Warning: Each child in a list should have a unique "key" prop.][85%]
  • [#5853][🐛[BUG] StatisticCard 报 Each child in a list should have a unique "key" prop.][83%]

github-actions[bot] avatar Sep 14 '22 03:09 github-actions[bot]

我也是这个情况,更新到最新版也一样

amin168 avatar Sep 15 '22 04:09 amin168

一样的情况,嵌套ProCard就会出现

windson4 avatar Sep 16 '22 00:09 windson4

修复了,更新版本即可

chenshuai2144 avatar Dec 26 '22 11:12 chenshuai2144