android
Which versions are you using:
should display all the tabs
display only first tab
More:
When I display basic example, everything works fine. However when I try to use map over array to render simple view with text, it renders only first page, other pages of swiper are blank.
same complication bro.
same complication bro.
For me the solution was checking if an array is not empty before rendering. Data that I wanted iterate over was fetched asynchronously. At first render it was not fully fetched so the error with swiper occurred. The code that actually works:
render () {
return (
{data && data.length !== 0 &&
<Swiper
ref={this.setSwiperInstance}
loop={false}
height={this.state.height}
removeClippedSubviews={false}
showsPagination={false}
onMomentumScrollEnd={this.onSlideEndHandler}
>
{
data.map((item, index) =>
<View>
<Text>{index}</Text>
</View>,
)
}
</Swiper>
}
)
}
You have to check data before rendering!
Most helpful comment
For me the solution was checking if an array is not empty before rendering. Data that I wanted iterate over was fetched asynchronously. At first render it was not fully fetched so the error with swiper occurred. The code that actually works: