You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so today i had a problem and while i was reserching it, i discover that changing props doesnt update an infinite scroll component. Or it does update but event listeners are still there and they fire loadMore function when it shouldnt.
My situation is that i have two props, first one is total_count and other one is the count of actual items that i receive from the server.
and my implementation of hasMore is looks something like:
hasMore = count < total_count
So on the first render i have 0 < 10 which is true and on the second render when server responded with items i have 10 < 10, which is false. So when i scroll down it invokes loadMore function despite the fact that hasMore is actually false. When i looked onto InfiniteScroll in react devtools, i found that hasMore prop is false. So that's definitely not the problem of my code.
The text was updated successfully, but these errors were encountered:
so today i had a problem and while i was reserching it, i discover that changing props doesnt update an infinite scroll component. Or it does update but event listeners are still there and they fire loadMore function when it shouldnt.
My situation is that i have two props, first one is total_count and other one is the count of actual items that i receive from the server.
and my implementation of hasMore is looks something like:
hasMore = count < total_count
So on the first render i have 0 < 10 which is true and on the second render when server responded with items i have 10 < 10, which is false. So when i scroll down it invokes loadMore function despite the fact that hasMore is actually false. When i looked onto InfiniteScroll in react devtools, i found that hasMore prop is false. So that's definitely not the problem of my code.
The text was updated successfully, but these errors were encountered: