akiran / akiran/react-slick

Encountered two children with the same key warning

未关闭
#2,117 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
11.9k
派生
2.1k
PR 合并指标
30 天内没有已合并 PR

描述

Hey, at first I want to say that I just found this lib and I want to say that it made easier life for me => so thank you a lot.

second I'm having an issue right now.

Here is the error log:
``` Warning: Encountered two children with the same key, `original4`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.```

here is my code snippet:
```
import React from "react";
import Slider from "react-slick";

export default function Types({ typeList, setName }) {
if (typeList.length === 0) return

empty type
;
const settings = {
dots: true,
infinite: true,
centerPadding: "60px",
slidesToShow: 3,
speed: 500,
rows: 2,
slidesPerRow: 2,
autoplay: true,
autoplaySpeed: 2000,
pauseOnHover: true,
arrows: false,
lazyLoad: true,
};
return (


{typeList.map((p, i) => (

{
setName(p.name);
}}
/>

))}


);
}

```

Thanks

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。