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 ran into an issue recently where I had a component that unmounted but on the unmount that cache in SWR was also changed on the unmount, and on the mount again SWR did not notice that the data it had was in fact incorrect. To remedy this I performed cleanup on my useEffect, which included setting my data to null. I was wondering if this is standard practice to have to reset the data, or if this could potentially be a bug?
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
-
I ran into an issue recently where I had a component that unmounted but on the unmount that cache in SWR was also changed on the unmount, and on the mount again SWR did not notice that the data it had was in fact incorrect. To remedy this I performed cleanup on my useEffect, which included setting my data to null. I was wondering if this is standard practice to have to reset the data, or if this could potentially be a bug?
EDIT:
Wrong SWR repo (Meant to post on Vercel/SWR
Beta Was this translation helpful? Give feedback.
All reactions