swr
swr copied to clipboard
React Hooks for Data Fetching
There are often times in a web application where you need to send a request for the latest user interaction. We need a way to prevent subsequent (async) logic from...
Implemented in accordance with the [RFC][1]. Initial implementation is mostly a copy/paste of `useSWR`, then moved things into arrays so we can handle the list aspect of this correctly. Plenty...
# Bug report ## Description / Observed Behavior In some scenarios, I'd expect onSuccess to be called, but it doesn't. E.g. a route "/foo" populate the state inside SWR's onSuccess....
# Bug report ## Description / Observed Behavior React 18 and SWR fails on the simplest of examples. I've created a sandbox at this URL: https://codesandbox.io/s/long-cdn-qxkc3v?file=/pages/indexSuspense.js that if your browse...
To support subscription / disposable / observable data source, adding a new hook useSWRSubscription built on top of useSWR. ### API ```tsx import type { Configuration } from 'swr' import...
Hi! I am using passing objects feature (https://swr.vercel.app/docs/arguments#passing-objects) like this. Unfortunately, This obviously leads to incorrect execution. But you won't know until execute project. because this fetcher infers the type...
# Bug report I can not manually refresh data using `mutate` when using `SWRInfinite` and `revalidateFirstPage: false` and key of that mutate is not bound to current page. ## Description...
# Bug report The `mutate` method exposed via `useSWRInfinite` is only ideal for situations when you want to revalidate/refetch all the pages (all the data corresponding to a specific pageIndex)...
Alternative to #168 Fixes #5 This PR isolates the suspense guarding into a function, which is then called in the `data` and `error` getters returned from `useSWR`. This allows you...
⚠️ This proposal isn't finalized yet. An abort signal will always be passed to `fetcher` via the option: ```js useSWR('/api', (url, { signal }) => { return fetch(url, { signal...