useInfiniteScroll
Load the next page when a sentinel element at the end of a list scrolls into view. It never fires while a load is running, keeps loading while the sentinel stays visible, and stops after an error until you retry.
- Level
- Advanced
- Since
- v2.1.0
import {useInfiniteScroll} from '@zenuilabs/react-hooks';Loading demo_
More in Async & Data
Async & DataIntermediateuseAsyncRun an async function and track its loading, error and data. Only the most recent call updates state, so a slow earlier call never overwrites a newer result.Async & DataIntermediateuseAsyncRetryRun an async function and retry it when it fails, with a fixed delay or backoff. Use it for flaky network calls that usually succeed on a second try.Async & DataAdvanceduseCachedFetchStale-while-revalidate data fetching with a cache shared by every component. Cached data renders instantly while a background request refreshes it.