react-infinite-scroll-component icon indicating copy to clipboard operation
react-infinite-scroll-component copied to clipboard

hasMore prop is being ignored

Open b4l4zs opened this issue 5 years ago • 5 comments

The next function doesn't get called if the data length didn't change after the previous call, even though I pass true to the hasMore prop. I want the next function to be called even if the data length didn't change after the previous call.

b4l4zs avatar Oct 12 '20 12:10 b4l4zs

Can't get next() to fire. I made infinite scroll it work with 2 virtualization lists, 1 normal list. But this one seems to never call the next function. Don't know why yet. Whereas it display endMessage at the bottom when setting hasMore={false}.

KeitelDOG avatar Feb 28 '21 21:02 KeitelDOG

I got it to work, use parent scrollable div. Maybe the ancestors containers has been in conflict with the scrolling calculations, because one of them had overflow auto already. But using a direct parent did it.

KeitelDOG avatar Feb 28 '21 22:02 KeitelDOG

I had the same problem and I solved passing a different key (basically remount the component) when I need the component fires the next() event again. I hope that helps

gabe2code-opstalent avatar Mar 12 '21 23:03 gabe2code-opstalent

@gabe2code-opstalent Yeah it seems like it has something to do with rerendering. If you remove the key, you can reproduce that solution (with hot-reload) just by making a simple change (like adding and removing a console log) so you force a re-rendering. When it rerenders it loads the next page.

exapsy avatar Apr 07 '21 19:04 exapsy

I had the same problem and I solved passing a different key (basically remount the component) when I need the component fires the next() event again. I hope that helps

@gabe2code-opstalent Could you please explain what do you mean by passing different key? Do you mean key="xx" attribute on the element of the list?

YuryYaroshevich avatar May 13 '21 14:05 YuryYaroshevich