i6mi6/react-native-parallax-scroll-view

FlatList onReachedEnd and stickySection is not working

bactn opened this issue · 2 comments

bactn commented

I tried to put a FlatList inside your ParallaxScrollView. Basically, It seems to be worked well, but when I try to use FlatList's StickySectionHeader and onReachedEnd callback, none of them works. OnReachedEnd is never called and StickySectionHeader makes no effects.

I tried to put some logs into renderItems method and I figured out, FlatList always re-render all its items when scroll. As I know, FlatList only draws its items one by one when item appears on screen. When I use FlatList without ParallaxScrollView, It works well

Please help

Hi try something like this
onEndReached={this._ItemLoadMore()}
don't use .bind(this)
this works for me

bactn commented

Thanks for your suggestion!
I also called to load more when initialization screen. But It doesn't work for me.
This is my code which using:
<FlatList contentContainerStyle={styles.container} ref="ListView" initialNumToRender={this.props.data.length} data={this.props.data} stickySectionHeadersEnabled={true} renderItem={({ item }) => ( this.renderRow(item) )} onEndReached={this.onFlatListEndReached(0)} onEndReachedThreshold={0.1} stickyHeaderIndices={this.state.stickyHeaderIndices} />