react报错:Warning: Each child in a list should have a unique “key“ prop.

发布于:2024-04-29 ⋅ 阅读:(31) ⋅ 点赞:(0)

我是万万没想到的,使用Popconfirm不添加key属性也会报错:

@react-refresh:160Warning: Each child in a list should have a unique "key" prop. Check the render method of `Cell`. Seehttps://reactjs.org/link/warning-keys for more information. athttp://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:33866:34 at Cell3 (http://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:37961:25) athttp://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:38077:22 at tr at BodyRow (http://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:38316:25) at tbody at Provider3 (http://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:37860:22) at Body (http://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:38520:19) at table at div at div athttp://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:39317:23 at div at Table (http://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:39327:25) at div at div at Spin2 (http://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:32044:25) at SpinFC2 (http://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:32089:34) at div at InternalTable (http://localhost:5173/node_modules/.vite/deps/chunk-2Q4JEYIA.js?v=2824dff9:43767:34) at div at div at LicenseList (http://localhost:5173/src/pages/StoreRun/serve/list/index.tsx?t=1714118344716:36:22) at InnerLoadable2 (http://localhost:5173/node_modules/.vite/deps/@loadable_component.js?v=2824dff9:155:34) at LoadableWithChunkExtractor2 at Loadable

给Popconfirm添加key属性后就好了.......

害我找了好久才找到这种神奇的bug

 


网站公告

今日签到

点亮在社区的每一天
去签到