Closed rauchg closed 2 years ago
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.
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.