the dots were not changing when using map to display data #637
Open
Description
Hi I am using your module and I wrote like this :
<Swiper index={this.state.index} style={styles.swipe} autoplay={false} horizontal={true}
dotColor="transparent"
activeDotColor="transparent"
onIndexChanged={(index) => {
alert("hi")
this.setState({
index: index,
})
}}>
{swiperList.map((res,i)=>{
let durationMinutes = res.duration / 60
let durationText
if (durationMinutes < 1) {
durationText = res.duration + ' sec'
} else if (isNaN(durationMinutes)) {
durationText = ''
} else {
durationText = durationMinutes + ' min'
}
return(
<View style={styles.swiperView}>
<View style={styles.addRoutineMainCardViewMainMorning}>
<Thumbnail large source={{uri : 'https:'+res.backgroundImage.file.url , cache: 'force-cache'}} style={styles.routineCreatedCardlogoimage} />
<Thumbnail source={Images.createroutinetimeButton['morning']} style={styles.routineCreatedCardOverlayimage} />
</View>
<Text style={styles.swiperText}>{res.title}</Text>
<Text style={styles.swipertimetext}>{durationText}</Text>
</View>
)
}
)}
</Swiper>
here when I swiper the onIndexChanged is not at all calling
And I did not use lopp but my data is showing twice
Can you tell me how to fix this..
Metadata
Assignees
Labels
No labels