flâneur

React Hooks for Data Fetching – SWR

swr.vercel.app · 340 words · saved by 5 readers

React Hooks for Data Fetching.

SWR keeps your UI fast and reactive A React Hooks library for data fetching. It revalidates on focus, on network recovery, and on an interval, so components stay current on their own. Fetch data with one hook Pass a key and a fetcher to useSWR. The hook manages the request, caches the response, and keeps data fresh. You get data, error, and isLoading to drive your UI. Make it reusable Need the same data in many places? Wrap useSWR in a custom hook once and reuse it across your components. Caching, deduplication, and revalidation are shared automatically. One request, shared everywhere…

saved by

related reading