akiran / akiran/react-slick

Encountered two children with the same key warning

Ouverte
#2,117 1 commentaire 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
11.9k
Forks
2.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.