How can i prevent react suspense flashing of fallback spinner #2398
Replies: 2 comments 4 replies
-
Can you create a Loom video explaining and showing what the problem is? |
Beta Was this translation helpful? Give feedback.
-
React-query does not cache data between manual page refreshes, only during client-side navigations within the SPA. Although I think this is something they are looking to add in the future |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone
on my page i am using the
useCurrentUserhook something like this:when the page loads, I see my
<FullScreenLoader />for one second. That the loading time is so low is of course great, but unfortunately the transition between loading screen and page content is broken by react suspense.I have already read some stuff on stackoverflow about this. It seems that at the moment there is no direct Suspense API to play and stop animations in a controlled way, right? Are there other ways to make the transition a bit smoother?
Run again
and one more thing I noticed. Every time I reload the page the
useCurrentUser()hook is executed. Is this not cached since it is a query? If so, why do I still see the fallback component, even if only shortly?Beta Was this translation helpful? Give feedback.
All reactions