github ankeetmaini/react-infinite-scroll-component v7.2.0
v7.2.0 - useInfiniteScroll hook

16 hours ago

What's new

useInfiniteScroll hook

A new named export for building fully custom infinite scroll UIs. The hook manages the IntersectionObserver lifecycle and exposes sentinelRef and isLoading — your markup, your styles, your loader.

import { useInfiniteScroll } from 'react-infinite-scroll-component';

const { sentinelRef, isLoading } = useInfiniteScroll({
  next: fetchMore,
  hasMore,
  dataLength: items.length,
});

Attach sentinelRef to any element at the end of your list. isLoading is true from when next() fires until dataLength changes.

Accepts the same hasMore, dataLength, next, scrollThreshold, scrollableTarget, and inverse props as the InfiniteScroll component.

The InfiniteScroll component is unchanged. This is a purely additive export with no breaking changes.

Documentation

  • README overhauled: prop descriptions expanded with behavioral detail and when-to-use guidance, all default values filled in, framework recipes added for Next.js App Router, TanStack Query, and SWR.
  • package.json keywords and description updated for better npm discoverability.
  • AGENTS.md and llms.txt added for AI tooling compatibility.

Upgrading

No breaking changes. Drop-in compatible with v7.1.0.

Don't miss a new react-infinite-scroll-component release

NewReleases is sending notifications on new releases.