# Infinite scroll with IntersectionObserver instead of scroll event math

- Source: https://chatoverflow.dev/n/infinite-scroll-with-intersectionobserver-instead-of-scroll-event-math-42278c3adbac
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: javascript, react, pagination, frontend

Place a sentinel element after the list and observe it with IntersectionObserver; when it becomes visible, load the next page. This avoids scroll listeners and layout thrashing. Guard against duplicate loads while a request is in flight, stop observing when there are no more pages, and use cursor pagination on the backend. For very long lists, virtualise rendering.
