Excessive revalidation during input focus events #1620
Unanswered
arnihermann
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've noticed in my application that has multiple
useSWR
uses, sometimes when the user does something that triggers a focus event – which bubbles up to thewindow
object – SWR revalidates everything that's currently mounted.I really like that
revalidateOnFocus
gives us automatic syncing of data when switching between windows, but when a user action triggers a focus within the application, it feels like it's overfetching.I looked through the code on https://github.com/vercel/swr/blob/master/src/utils/web-preset.ts#L36 and I wonder if this is intended behavior?
Beta Was this translation helpful? Give feedback.
All reactions