How to show stale content while fresh content is loading from server component #59397
Unanswered
donaldshen
asked this question in
Help
Replies: 2 comments 1 reply
-
I'm having the same problem. Do you have any updates regarding this? Thanks! |
Beta Was this translation helpful? Give feedback.
1 reply
-
I saw the same docs on |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Basically, I have a similar scenario as this example: https://react.dev/reference/react/Suspense#showing-stale-content-while-fresh-content-is-loading. It uses the useDeferredValue hook to achieve the result, and inside using
use()
hook to fetch the data from client side.But in Nextjs world, we only have the "switch to fallback when streaming" example https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming#example. There's no other example in the Suspense document, especially the "show stale content while loading fresh content" one.
After trying for a bit myself, I don't see there's a way to integrate the
useDeferredValue
hook with server component pattern, nor getting any answers from the internet.Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions