Recyclerlistview: onEndReached not called if RecyclerListView is contained within a View

Created on 4 Aug 2019  路  6Comments  路  Source: Flipkart/recyclerlistview

Like the title says, onEndReached is never called if RecyclerListView is wrapped in a view

    const { width, height } = Dimensions.get('window');

    return (
      <View style={{width: '100%', height, flex: 1 }}>
        <RecyclerListView 
          ref={ref => this.listRef = ref}
          initialRenderIndex={currentIndex}
          layoutProvider={this._layoutProvider} 
          dataProvider={images} 
          rowRenderer={this._rowRenderer} 
          onEndReachedThreshold={0.75}
          onEndReached={this.loadNextPage}
          style={{flex:1}}
        />
        {isLoading &&
          <Bar indeterminate width={null} height={2} borderRadius={0} />
        }
      </View>
    );   

This works totally fine if I remove the View, and I have tried different style options as suggested here to no avail. Tired the latest beta version and had no improvements.

Can I get some help here please?

Most helpful comment

@fariya12 @abrenoch Was facing the same issue on Android. Add 'renderFooter' and it will work in Android as well.

All 6 comments

Why have you passed height and flex:1 both? Provide a repro on expo for me to look into. This looks like a problem with the style applied on wrapping View

Why have you passed height and flex:1 both? Provide a repro on expo for me to look into. This looks like a problem with the style applied on wrapping View

I was experimenting and just copied what I was working with - I tried several different combinations of styles and none seemed to work. I was however able to get the behavior I was after by using the renderFooter property. If this becomes an issue for me again I'll put together a demo expo repo.

facing this issue how to solve any solution ??

Could you help us with a demo expo as we are not able to reproduce the above issue?

@fariya12 @abrenoch Was facing the same issue on Android. Add 'renderFooter' and it will work in Android as well.

I am also facing this issue @naqvitalha . It is wrapped in a view with style={{ flex: 1}}
image

Any solution? Also when it reached end item the screen is hanged.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VilleKokkarinen picture VilleKokkarinen  路  6Comments

mmamoyco picture mmamoyco  路  7Comments

ErHarinderSingh picture ErHarinderSingh  路  6Comments

nehacurefit picture nehacurefit  路  4Comments

h-asadollahi picture h-asadollahi  路  8Comments