We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetcher
fetch
I ran into a scenario where passing a custom fetcher to useSWR was still creating fetch calls.
useSWR
I had to work around it as follows unfortunately:
const swr = createSWR({ fetcher: readUser }); const { data: user, revalidate } = swr.useSWR("usertest", { dedupingInterval: 0, revalidateOnFocus: false, });
I was noticing that if I passed fetcher to useSWR instead, I'd see XHR to /usertest even though my fetcher doesn't use XHR at all.
/usertest
The text was updated successfully, but these errors were encountered:
That shall be fixed! The fetcher from the initial call will be respected if you revalidate or mutate from the given result func.
const { data: user, revalidate } = useSWR('...', { fetcher }) revalidate() // Should now respect fetcher.
Sorry, something went wrong.
ConsoleTVs
No branches or pull requests
I ran into a scenario where passing a custom
fetcher
touseSWR
was still creatingfetch
calls.I had to work around it as follows unfortunately:
I was noticing that if I passed
fetcher
touseSWR
instead, I'd see XHR to/usertest
even though myfetcher
doesn't use XHR at all.The text was updated successfully, but these errors were encountered: