Skip to content

Files

Latest commit

 

History

History

optimistic-ui

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Optimistic UI

One-Click Deploy

Deploy your own SWR project with Vercel.

Deploy with Vercel

How to Use

Download the example:

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

Install it and run:

yarn
yarn dev
# or
npm install
npm run dev

The Idea behind the Example

Example of how to use SWR to implement an Optimistic UI pattern where we mutate the cached data immediately and then trigger a revalidation with the API.