ankeetmaini / react-infinite-scroll-component

An awesome Infinite Scroll component in react.
https://react-infinite-scroll-component.netlify.com/
MIT License
2.87k stars 322 forks source link

Scroll move back to top on loadmore data #306

Open yasir-rafiq opened 2 years ago

yasir-rafiq commented 2 years ago

<InfiniteScroll height={'800px'} dataLength={this.props.items.length} next={this.fetchMoreData} hasMore={true} loader={<></>}

{this.props.items.map((item, index) => { if((_this.props.filters.favourite == 1 && item.favourite == 1) || (_this.props.filters.favourite == 0)) {

                      return <items />
                      // </Animatable.View>

                    }
                  }
                )}
            </InfiniteScroll>
utiq commented 2 years ago

@yasir-rafiq I'm having the same issue, how did you solve it?

PabloReszczynski commented 2 years ago

I think this has to do with the item list being passed as prop instead of an internal state. Hopefully the devs will se this.

Smitgamit commented 2 years ago

solved! use InfiniteScroll component as parent Div

Talhafayyaz11 commented 2 years ago

I am having the same issue did someone solved this issue?

shadowgroundz commented 1 year ago

solved! use InfiniteScroll component as parent Div

Solve because not caused re-render