Replies: 1 comment 1 reply
-
As the documentation says, this is an expected behavior. I'd say say you can check |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Bug report
Description / Observed Behavior
isLoading
becomes true on the first request even though data is already available for the given key through SWRConfig'sfallback
, which makes the UI show a loading indicator for the first revalidation (as ifisValidating
was used).Expected Behavior
Expected
isLoading
to remain false when initial data for a given url/key is provided from server (getServerSideProps/getStaticProps).Repro Steps / Code Example
CodeSandbox
Trigger page reload in CSB to see the loading indicator.
Additional Context
[email protected]
Documentation says
although I'm not sure if this includes
fallback
or onlyfallbackData
.Previously was using https://swr.vercel.app/docs/middleware#keep-previous-result but wanted to reduce code with the new
isLoading
andkeepPreviousData
. Should I keep using the middleware?Beta Was this translation helpful? Give feedback.
All reactions