react-infinite-scroll-component
react-infinite-scroll-component copied to clipboard
When adjusting the height of the window, loader is exposed but nothing will load
I'll have a short window, and when I extend the height down to see more results, I get maybe a few that will show, but my loader which says "Loading..." will also be in view but refuses to load anymore data.
What's the best way to handle this?
@2hands10fingers I struggle with the same issue. Have you already found any solution?
I got same problem. In my case, i found that if dataLength
is changed after each loading then i can load more data
Example:
Not load: dataLength={totalNumberOfRecords} // dataLength never change
Load more: dataLength={currentNumberOfRecords} // dataLength change after each load
Here is what im doing as a workaround.
All i do is check every render if the scrollHeight
is equal to the offsetHeight
of the scrollableTarget
provided to the InfiniteScroll
. If it is then we know we need to load more data. If it isnt we dont need to do anything.