React Native Flatlist Scroll issue

Viewed 373

I am new to react native. i am using flatlist for loading 10000 items. i am using lazy loading for getting items. problem is when i rendered more items and i tried to scroll to upper direction, it scrolls before rendering the items. is there any solution..? or can we controll the speed of the scroll..?

<FlatList
      ref="flatList"
      data={this.state.skus_list}
      keyExtractor={(item, index) => `post__${item.id}`}
      renderItem = {this.renderItem}
      ListFooterComponent={this.renderFooter}
      ListEmptyComponent={this.onEmptyData}
      onEndReached={this.loadMoreSkus}
      initialNumToRender={20}
      maxToRenderPerBatch={20}
      extraData={this.props.orders.orders}

/>
1 Answers

Use methods onScroll and onScrollAnimationEnd

Fetch data in onScroll Method.

Update state on onScroll or onScrollAnimationEnd

Related