Closed keatwei closed 6 years ago
Sorry, so late to response. Here is my suggestion.
render(){
const images = this.props.carousels;
if (!images || images.length === 0) {
return null;
}
return(
......
<Carousel
autoplay
autoplayTimeout={5000}
loop
index={0}
showsPageIndicator={ false }
pageSize={BannerWidth}
>
{ images.map((image, index) => this.renderPage(image, index))}
</Carousel>
......
);
}
Don't render carousel when the image list length is 0.
@f111fei yup. its working. thx
Hi @keatwei , Can you help me in passing JSON of array consisting of Objects as datasource. Please have a look at the issue opened by me: How to pass JSON of Images as Data Source?
Hi I'm currently having problem loading images from API, here is my StackOverflow. https://stackoverflow.com/questions/48009345/how-to-make-react-native-banner-carousel-load-images-from-apiasynchronous
Any suggestion on the asynchronous issue?