Skip to content

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

Description

@A-M-Alizadeh

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions