首页 > 解决方案 > ScrollToIndex 超出范围:请求索引 NaN,但最大值为 3 -- SwiperFlatList

问题描述

这是我的 swiperflatlist 组件,我在其中从 api 渲染图像,但是为什么我会收到这个错误,我不明白请告诉我为什么会收到这个错误?

index nan 应该但是组件被称为 flatlist 的映射?

    <SwiperFlatList
      autoplayDelay={2}
      autoplay
       autoplayLoop
      index={0}
    data={this.state.achhamall}
    renderItem={({item}) => // Standard Image
                   <View style={[styles.child, {  }]}>


             <Image
                  style={{height:400, width: width , resizeMode:'contain'}}
                  source={{uri: item.image}}
                />
                </View>
                    }
    showPagination
  />

标签: react-nativereact-native-flatlist

解决方案


推荐阅读