You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common use case we have in our applications is to have a top level component call useSWRV with a fetcher, but then have many lower level component call useSWRV with the same key but without providing a fetcher that way the children components can get the data without forcing to be fetched again, it is only the top level component that is concerned with revalidating the data.
The documentation still talks about not passing a fetcher to force SWRV to use the cached values, but I don't think that is true anymore with the introduction of a default fetcher. I think having to opt in for the default fetcher is the way to go, maybe if you pass true as the second parameter it will use the default fetcher and if you pass undefined it will use no fetcher and it will fetch from the cache.
The text was updated successfully, but these errors were encountered:
A common use case we have in our applications is to have a top level component call
useSWRV
with afetcher
, but then have many lower level component calluseSWRV
with the samekey
but without providing afetcher
that way the children components can get the data without forcing to be fetched again, it is only the top level component that is concerned with revalidating the data.This was working just fine before, but the introduction of a default fetcher changed that behavior, specifically this:
a907d49#diff-0988ac9996eafadcefcd62192f6fa8e63983c4d7b5d04c1604bb21d8096ef77cR185-R189
The documentation still talks about not passing a fetcher to force SWRV to use the cached values, but I don't think that is true anymore with the introduction of a default fetcher. I think having to opt in for the default fetcher is the way to go, maybe if you pass
true
as the second parameter it will use the default fetcher and if you passundefined
it will use no fetcher and it will fetch from the cache.The text was updated successfully, but these errors were encountered: