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 am filling up the cache of a useProductDetail hook after a search hook performed using cache.set(productKey(id), product) but when the useProductDetail hook is used, it still revalidates and hits the server again although the cache was just updated.
Sure I can set revalidateOnMount to false but that brings other undesired side effects.
Even after one year I am still unclear on the inner workings of swr in such situations.
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.
-
I am filling up the cache of a
useProductDetail
hook after a search hook performed usingcache.set(productKey(id), product)
but when theuseProductDetail
hook is used, it still revalidates and hits the server again although the cache was just updated.Sure I can set
revalidateOnMount
to false but that brings other undesired side effects.Even after one year I am still unclear on the inner workings of swr in such situations.
Beta Was this translation helpful? Give feedback.
All reactions