Replies: 1 comment 3 replies
-
Could you provide a CodeSandbox to replicate this issue? |
Beta Was this translation helpful? Give feedback.
3 replies
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.
-
If I prefetch a key and then load a component with useSWR revalidateOnMount: true using the same key, before the prefetch has resolved - the request ends up validating and never resolves.
I can fix this by pre-fetching the key and in the component have revalidateOnMount: false on the useSWR as you suggest...
But if I haven't pre-fetched the key, and the component is set to revalidateOnMount: false, then that component never loads the data!!!
And this only works when not using suspense, with suspense it ends up in a never ending re-rendering loop.
Beta Was this translation helpful? Give feedback.
All reactions