Force useSWR
return data fetching not to be undefined with config.fallbackData
#1765
Unanswered
tannguyencse19
asked this question in
Q&A
Replies: 1 comment
-
+1 It would be great for this behavior to work with SSR as well for dynamic fetching, to have some sort of globally shared variable that could serve as a revalidated cache (e.g. a user object fetched via /api/me in the root layout that is expected to be available throughout the app, and could be mutated once the user updates their profile) |
Beta Was this translation helpful? Give feedback.
0 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.
-
Continue from #1764 😄
I want to return static data when
useSWR
fetch error or data isundefined
.I try this
data
type stillstatic_data_type | undefined
. Any short way to get around this?Don't know this way will also make useSWR return data not undefined or not?
Beta Was this translation helpful? Give feedback.
All reactions