How to stop useInifiniteScroll
firing onLoadMore
function after all data are displayed?
#3490
Unanswered
AloisSeckar
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Maybe we can improve this, feel free to open an issue, happy to resolve it :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I know it is called "infinite", but lets say I have 100 items - I want to display first 10, then upon scrolling down keep displaying more and more 10 until all 100 are visible. But then, how can I stop it from triyng to load more data? Ofc I can write the function with a guard, so it returns immediately, but can I prevent the callback from being called at all once it is no longer needed? Is there an option? Or should I rather use something else than
useInfiniteScroll
for this case?EDIT: Also bonus question - I just also noticed my callback keeps running even after leaving the page. How to properly remove it in
onUnmounted
hook?Beta Was this translation helpful? Give feedback.
All reactions