[Solved] React: Warning each child in a list should have a unique key [duplicate]


It’s definitely an array key issue, but it seems you have unique alt attributes in each data set (array).

<StyledHorizontalScrollList columns={columns}>
  {tunesTeasers.map(teaser => teaser.noTonieboxes ? (
    <List key={teaser.alt} onClick={toggleModal}>
      <TeaserCard alt={teaser.alt} src={teaser.src} />
    </List>
  ) : (
    <StyledLink key={teaser.alt} to={teaser.link}>
      <TeaserCard alt={teaser.alt} src={teaser.src} />
    </StyledLink>
  )}
</StyledHorizontalScrollList>

solved React: Warning each child in a list should have a unique key [duplicate]