Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
A-M-Alizadeh opened this issue Jul 30, 2019 · 0 comments
Open

Comments

@A-M-Alizadeh
Copy link

A-M-Alizadeh commented Jul 30, 2019

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)
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant