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
Hi, First of all thanks for this rocking lib. Im exploring it these days, its awesome.
Now to my issue,
I'm rendering a component that uses useSWR like such -> useSWR('key', fetcher).
After the component unmounts, and re-mounts again, Im noticing that the useSWR does infact bring back the cached results, but it also triggers a revalidation.
Is this the expected behavior?
If so, can you please supply a flag indication to cancel it? locally & globally
Thanks, Looking forward for your response
The text was updated successfully, but these errors were encountered:
That is an intended behavior, the name of the library comes from the idea to first show stale data then revalidate it against the API and update it to show the correct data (stale-while-revalidate aka SWR).
There is a PR #225 intended to add a flag to set SWR to don't revalidate the cache on mount and let you manually do it if you want (it will still fetch it if it wasn't already provided with the initialData option).
Hi, First of all thanks for this rocking lib. Im exploring it these days, its awesome.
Now to my issue,
I'm rendering a component that uses useSWR like such -> useSWR('key', fetcher).
After the component unmounts, and re-mounts again, Im noticing that the useSWR does infact bring back the cached results, but it also triggers a revalidation.
Thanks, Looking forward for your response
The text was updated successfully, but these errors were encountered: