FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
2.99k stars 594 forks source link

Map render a unique slide in the carousel #1062

Open mbayou opened 3 weeks ago

mbayou commented 3 weeks ago

Is there an existing issue for this?

Code of Conduct

Code Sandbox link

No response

Bug report

Hi, 

I am struggling building up my carousel. It looks like when using a map to create React Component in the carousel they just appear in on slide. 

I am sure I am doing something wrong so really any guidance would be very welcome. 

export const AnnounceCard = ({language, token}: AnnounceCardProps) => {
  ...
  return <Card>
    <CardContent>
      <Carousel showArrows showDots>
        {announces.map((announce, index) => (<div key={index}>
          <Typography>ANOTHER {announce.title}</Typography>
          <Typography>ANOTHER {announce.details}</Typography>
        </div>))}
      </Carousel>
    </CardContent>
  </Card>
}