Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
Nextjs infinite scroll function not loading more data on scrolling

Hello I am struggling to implement infinite scroll from last few days. I used django rest for building my api. Here is my pagination url https://example.com/blog-api/?page=1it will show 2 items per page. Here here my code

const fetchMoreData = async () => {
    let url = `https://backendapi.farhyn.com/blog-api/?page=${count + 1}`;
    SetCount(count + 1);
    const res = await fetch(url);

    const data = await res.json();
    SetBlog(data)
    console.log(data);
  };

 <InfiniteScroll
      dataLength={blog.results.length}
      next={fetchMoreData}
     hasMore={true}
    loader={<h4>Loading...</h4>}
 >{blog.results.map((data) => ( {data.blog_title}   ))}
 </InfiniteScroll>

where I am doing mistake? data not loading on scroll.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!