Repository navigation
What is the default Fetcher function? #910
Answered
by
promer94
thiagonunesbatista
asked this question in
General
|
I started reading the documentation of SWR and I discovered that exists an optional param to useSwr called fetcher (a function to fetch data). If I just pass the key to useSwr and don't pass a fetcher, what function or code will be executed to fetch the data? |
Answered by
promer94
Jan 19, 2021
Replies: 2 comments
|
https://swr.vercel.app/docs/options#options fetcher = window.fetch(url).then(res => res.json()) |
0 replies
Answer selected by
thiagonunesbatista
|
This is no longner the case since SWR 1.0. The default fetcher function is now |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://swr.vercel.app/docs/options#options