akiran / akiran/react-slick

Encountered two children with the same key warning

Open
#2,117 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11.9k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.