meliorence / react-native-snap-carousel

Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
BSD 3-Clause "New" or "Revised" License
10.3k stars 2.28k forks source link

TypeError: undefined is not an object (evaluating 'items.forEach') #841

Open tinydiv333 opened 3 years ago

tinydiv333 commented 3 years ago

After setting project in ios my code throws this error "TypeError: undefined is not an object (evaluating 'items.forEach') "

dohooo commented 2 years ago

@tinydiv333 Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2

rubendario2567 commented 2 years ago

Excuse me. Do you have solution for this issue?

vishkashpvp commented 2 years ago

provided value might be a string... JSON.parse(your_string) once

DidacC91 commented 2 years ago

Any solution for this?

My code:<Carousel data={items} renderItem={({item}: any) => <CarouselCard item={item} />} sliderWidth={SliderWidth} itemWidth={300} />

items is a plain array of objects. If I set a string (JSON.stringfy(items)) it doesn't work... data needs a plain array. Although the error seems to be coming from the renderItem property.

Enaturale commented 1 year ago

It seems to be a recent issue. I am having the same error. Any solution please?