2024-04-19
2917
#nextjs
Rahul Chhodde
189067
109
Apr 19, 2024 ⋅ 10 min read

Implementing infinite scroll in Next.js with Server Actions

Rahul Chhodde I'm a software developer with over seven years of experience in different web technologies.

Recent posts:

A Guide To Graceful Degradation In Web Development

A guide to graceful degradation in web development

Implement graceful degradation in frontend apps by handling failures, mitigating API timeouts, and ensuring a seamless UX with fallbacks.

Rosario De Chiara
Feb 11, 2025 ⋅ 4 min read
Building High-Performance Websites Using Htmx And Go

Building high-performance websites using htmx and Go

Use htmx and Go to build high-performance websites, leveraging server-side rendering and minimal JavaScript for fast and efficient applications.

Abhinav Anshul
Feb 10, 2025 ⋅ 11 min read
improving ux with scroll-select box

How to improve UX with a scroll-select box

The scroll-select box is a great tool for frontend developers to improve the user experience of their applications. Learn how to build a scrollable date picker that mimics the iOS style, but with the exemption of the <select> element.

Emmanuel Odioko
Feb 7, 2025 ⋅ 10 min read
Deploying Next.js apps with Deno Deploy

Deploying Next.js apps with Deno Deploy

For those just getting started with deploying their first application, Deno Deploy’s simplicity might be exactly what you need; no complex configuration files to wrestle with or cloud concepts to master before getting your app live.

Emmanuel Odioko
Feb 6, 2025 ⋅ 5 min read
View all posts

4 Replies to "Implementing infinite scroll in Next.js with Server Actions"

  1. Your infinite scroll is broken. The code with a button works well. The code with intersection observer keeps repeating posts 11 – 20.

    1. Well spotted. The author asked me to send the following along: “I completely missed covering how closures can cause data duplication and be a real pain for the developer. Addressing and fixing the issue, I’ve added some updates to the article and the code. The only change in the code is the addition of one more state variable to the `useEffect` dependency array. Please check back and let me know if you have any more questions.”

Leave a Reply