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
I'm trying to let SWR get fresh data on a page refresh. I've disabled most of the revalidation configuration since I do not want it to revalidate when users are modifying data in the component. However, when I refresh the page, the data is returned as undefined and is not revalidated. I would expect it to do a new fetch since the cache was cleared during the refresh.
Enabling revalidateIfStale works, but this will also revalidate my component on mount, which is not what I want.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to let SWR get fresh data on a page refresh. I've disabled most of the revalidation configuration since I do not want it to revalidate when users are modifying data in the component. However, when I refresh the page, the data is returned as
undefined
and is not revalidated. I would expect it to do a new fetch since the cache was cleared during the refresh.Enabling
revalidateIfStale
works, but this will also revalidate my component on mount, which is not what I want.How can I make sure the data is fetched properly after a page refresh?
Beta Was this translation helpful? Give feedback.
All reactions