Carousel

ivonapilcevic asked 2 months ago

Expected behavior: I am using MDBReact Carousel with thumbnails, and if i just copy it from website it wokrs fine, but I need my images to be dynamic, so I use map function, but then it doesn't work.

Actual behavior: When I use map function inside MDBCarouselInner, like so:

<MDBCarouselInner>
    {images.map((image, id) => (
        <MDBCarouselItem itemId={id}>
            <img
                className="d-block w-100"
                src={image.url}
                alt="First slide"
             />
          </MDBCarouselItem>
    ))}
</MDBCarouselInner>

the Carousel just doesnt work properly. It doesn't render all available images, and last slide is empty. Can you please help me solve this problem?


Piotr Glejzer staff commented 2 months ago

Is just a prbolem with that if you use dynamic data from api?


Please insert min. 20 characters.
Status

Open

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: React
  • MDB Version: 4.27.0
  • Device: MacBook Pro
  • Browser: Chrome, Safari, Mozzila
  • OS: MacOs
  • Provided sample code: No
  • Provided link: No