akiran / akiran/react-slick

Encountered two children with the same key warning

Abierto
#2,117 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
11.9k
Forks
2.1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.