---
title: "Comment by Akshay Bhaskare on \"How to Implement Infinite Scrolling with React.js\" | Hashnode"
description: "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"
url: "https://hashnode.com/posts/how-to-implement-infinite-scrolling-with-reactjs/627ab5c9f543e7a92b804006/comment/63a555c33916c9c9a801f51c"
---

[Discussion](https://hashnode.com/posts/how-to-implement-infinite-scrolling-with-reactjs/627ab5c9f543e7a92b804006)

Comment [How to Implement Infinite Scrolling with React.js](https://hashnode.com/posts/how-to-implement-infinite-scrolling-with-reactjs/627ab5c9f543e7a92b804006)

[Akshay Bhaskare](https://hashnode.com/@akshay123)

[Dec 23, 2022](https://hashnode.com/posts/how-to-implement-infinite-scrolling-with-reactjs/627ab5c9f543e7a92b804006/comment/63a555c33916c9c9a801f51c)

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

[Jantu Deb](https://hashnode.com/@jantudeb)

[Dec 23, 2022](https://hashnode.com/posts/how-to-implement-infinite-scrolling-with-reactjs/627ab5c9f543e7a92b804006/comment/63a555c33916c9c9a801f51c#reply-63a5c497c39f50da11a58688)

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.

[Akshay Bhaskare](https://hashnode.com/@akshay123)

[Dec 25, 2022](https://hashnode.com/posts/how-to-implement-infinite-scrolling-with-reactjs/627ab5c9f543e7a92b804006/comment/63a555c33916c9c9a801f51c#reply-63a813beb1011ed9ec6d05c5)

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
