BotDanny / react-stacked-center-carousel

A responsive, performant, well animated, swipeable, center mode carousel that stacks its slide
33 stars 12 forks source link

Unable to remove all the extra images from the example #12

Closed HimanshuMenon closed 1 year ago

HimanshuMenon commented 1 year ago

Hi, I am implementing this carousel but I am unable to remove all the extra images that I am getting in the Demo Code. I am unable to remove two extra images from the data array.

This is what my current data array looks like

export const data = [
  {
    cover:
      "https://d25s2jqw4qdf1e.cloudfront.net/a80c4ba3-6a04-45e3-baa6-29cfbae77dfb.webp?imwidth=3840",
    title: "Interstaller",
  },
  {
    cover:
      "https://d25s2jqw4qdf1e.cloudfront.net/70526bde-da54-4c34-91b6-eafbf6baeaff.webp?imwidth=3840",
    title: "Inception",
  },
  {
    cover:
      "https://d25s2jqw4qdf1e.cloudfront.net/c9aae31f-9a66-4f56-9aab-211d5201b8d9.webp?imwidth=3840",
    title: "Blade Runner 2049",
  },
  {
    cover:
      "https://d25s2jqw4qdf1e.cloudfront.net/b81c80fe-1d87-4ad1-bb20-87d32f3596a7.webp?imwidth=3840",
    title: "Icon man 3",
  },
  {
    cover: "https://images3.alphacoders.com/948/thumb-1920-948864.jpg",
    title: "Venom",
  },
  {
    cover: "https://images4.alphacoders.com/665/thumb-1920-665242.png",
    title: "One Punch Man",
  },
];

When I remove the last object from the data it gives me the error Cannot read properties of undefined (reading 'cover') I hope you guys could guide me on what I might be doing wrong.

BotDanny commented 1 year ago

Hi, I am unable to reproduce your error. Can you provide a code sandbox link?

BotDanny commented 1 year ago

Closing the issue for now, if you can reproduce it with a code sandbox link then feel free to re-open the issue