react-hooks-infinite-scroll
react-hooks-infinite-scroll copied to clipboard
Prevent from fetching when no more datas
Hi,
I was wondering how would you prevent from fetching when there's no more data?
I've implemented your work in my project, but it keeps fetching when I'm scrolling down to the bottom page...
Cheers
first of all, we should to known that there is no data from frontend client, you can return a totalPages from backend api, such like this :
In this way, you can find whether there is more data to load based on currentPage and totalPages.
from your question, this is the way I used it in my project.