useSWR
is a client-side react hook for data fetching using the Stale-While-Revalidate (SWR) strategy. The strategy is simple:
- Starting from a
stale
state where the data is either static or can be retrieved quickly from a cache. - Concurrently
revalidate
the current state by fetching the data from a dynamic source.
-
Run the application.
npm install npm run dev
-
Navigate to http://localhost:3000.