Back to Swr

useSWRInfinite with scroll based on IntersectionObserver

examples/infinite-scroll/README.md

2.4.1640 B
Original Source

useSWRInfinite with scroll based on IntersectionObserver

One-Click Deploy

Deploy your own SWR project with Vercel.

How to Use

Download the example:

bash
curl https://codeload.github.com/vercel/swr/tar.gz/main | tar -xz --strip=2 swr-main/examples/infinite-scroll
cd infinite-scroll

Install it and run:

bash
yarn
yarn dev
# or
npm install
npm run dev

The Idea behind the Example

Show usage of useSWRInfinite with infinite scroll based on IntersectionObserver