Back to Swr

Focus Revalidate

examples/focus-revalidate/README.md

2.4.1658 B
Original Source

Focus Revalidate

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/focus-revalidate
cd focus-revalidate

Install it and run:

bash
yarn
yarn dev
# or
npm install
npm run dev

The Idea behind the Example

Basic authentication example showing how the revalidate on focus feature works and to trigger a revalidation on a per-hook call basis.