I have implement the above code for infinite scrolling in my project and its working fine, but there is a problem when all the data is loaded in the page it is still making API server call for more data when i scroll down, scrolling or loder should stop at the bottom when all the data is loaded, so please help me how i can achieve that
I guess backend can send additional information eg. last_page:true
And accordingly frontend can stop asking for more data. This code should be easy to extend.
Even suppose they send the last_page: true from the backend but in the useeffect how i can set the condition based on the api response, right now i am loading 12 videos per page. It will be great if you implement the same in above code
Akshay Bhaskare
I have implement the above code for infinite scrolling in my project and its working fine, but there is a problem when all the data is loaded in the page it is still making API server call for more data when i scroll down, scrolling or loder should stop at the bottom when all the data is loaded, so please help me how i can achieve that