PaulBGD / react-native-image-slider

A quick and easy image slider for react native. Maintainer wanted!
MIT License
237 stars 103 forks source link

customSlide method iterates all list twice for each slide change #81

Open A-M-Alizadeh opened 5 years ago

A-M-Alizadeh commented 5 years ago

slider-error

i logged my item to see it but i realized my whole data is logged twice for each slide change, have i done anything wrong?

<ImageSlider images={{data}} autoPlayWithInterval={2000} style={{ flex: .3 }} onPress={({ item }) => console.log('image->', item)} customSlide={({ item, width }) => ( // It's important to put style here because it's got offset inside <View key={Math.random()} style={{ flex: .3, flexDirection: 'row' }} > { console.log('item-> ',x++,item) } <Image source={ {uri: ${item.uri}} } style={{ height: 200, width }} /> <Text style={{ backgroundColor: 'rgba(0,0,0,.3)', borderBottomWidth: .5, borderBottomColor: 'rgba(255,255,255,.5)', padding: 10, width, color: 'white', position: 'absolute', top: 0, left: 0 }}>{item.title} )}(url) />