React-native-snap-carousel: cannot read property 'foreach' of undefined

Created on 24 Aug 2017  路  9Comments  路  Source: meliorence/react-native-snap-carousel

sliderWidth={viewportWidth}
itemWidth={viewportWidth}
slideStyle={{ width: viewportWidth }}
inactiveSlideOpacity={1}
inactiveSlideScale={1}
>



Most helpful comment

Hi guys,

Have you made sure to read the migration guide as well as the release notes for version 3.0.0?

As the version tag indicates, there were some breaking changes :-) Implementation is now based on FlatList instead of ScrollView, which changes the way to handle your slides.

All 9 comments

+1

"react-native-snap-carousel": "^3.0.0",
"react-native": "^0.44.0",

Implementation:
<Carousel ref={(carousel) => { this._carousel = carousel; }} sliderWidth={width} itemWidth={width * .9} > <View><Text>jbsfjhbfsdhjfbsdjfb</Text></View> <View><Text>kjasbndkjsdbnsjkdnasjkdnasjkasnjk</Text></View> </Carousel>

my version "react-native": "^0.45.1"

Cannot add property 2, object is not extensible, react-native version: "^0.45.1"

Hi guys,

Have you made sure to read the migration guide as well as the release notes for version 3.0.0?

As the version tag indicates, there were some breaking changes :-) Implementation is now based on FlatList instead of ScrollView, which changes the way to handle your slides.

@bd-arc hi, I may be wrong but dug in the code for Carousel.js line 781, replacing const customData = data, by let customData = [] and then pushing data in customData seems to solve the problem for me for now. I don't know what it is doing it here, or how can it be fixed. Line 780 in Carousel need to fix?

Please Suggest!

@VrajSolanki I made a mistake while publishing version 3.0.0 and ended up pushing some temporary code I forgot to stash...

Can you try version 3.1.0 and let me know if the issue persists?

@bd-arc Hi, i checked the commit but that does not fix the Carousel.js and that has CUSTOM_DATA check issue console log as well, if you could just have a look or I can request a PR and check my updates??
Issue https://github.com/archriss/react-native-snap-carousel/issues/129

@VrajSolanki You won't find a commit that fixes it because the mistake was made when publishing to npm (I forgot to stash some temporary code).

As you can see in the source code, there is no console.log() call. So, trust me: delete the appropriate folder in nodes_modules, update to 3.1.0 and the issue will be gone ;-) You can also take a look at this thread.

@bd-arc cool

Was this page helpful?
0 / 5 - 0 ratings

Related issues

duongkhoilinh picture duongkhoilinh  路  4Comments

amyogiji picture amyogiji  路  5Comments

niloufarMakhzani picture niloufarMakhzani  路  4Comments

akyker20 picture akyker20  路  3Comments

KarlosQ picture KarlosQ  路  4Comments