Answer the question
In order to leave comments, you need to log in
Why is React complaining about missing keys in a normal JSX chunk?
React throws an error: "Warning: Each child in a list should have a unique "key" prop" on a normal piece of JSX. Don't tell me why?
There is a component:
{
data.map((element) =>
<Card
key={element.key}
img={element.img}
name={element.name}
handleToggle={element.action()}
hoverTitle={element.hoverTitle}
desk={element.desk}
btnText={element.btnText}
btmMod={element.btmMod}
imgMod={element.imgMod}
bgMod={element.bgMod}
/>
)
}
<div
className={"card " + (bgMod)}
ref={cardWrapper}
>
<div
className={"card__nav card--zIndex"}
onClick={() => handleToggle(cardWrapper)}
>
<svg></svg>
</div>
<div className={"card__img " + (imgMod)}>
<img alt={name} src={img} />
</div>
<div className={"card__name card--zIndex"}>
{name}
</div>
<div className={"card__desk"}>
{desk}
</div>
<div className={"card__hover-title"}>
{hoverTitle}
</div>
<Button
mod={btmMod}
text={btnText}
/>
<svg></svg>
<div className={"card__inner"} />
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question