Replies: 2 comments 5 replies
-
Has somebody an idea? |
Beta Was this translation helpful? Give feedback.
0 replies
-
if you want streaming SSR, you have to Have a look at the advanced section in the docs: |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I'm working on a project using Next.js 14 and React-Query v5, focusing on a user management system with pages at /users and /users/< id >. I need to access a list of users across these pages, so I decided to fetch this data server-side in /users/layout.tsx and stream it to the client. This setup works well for initial data loading. However, I'm looking to enhance the user experience by loading the dashboard layout (including DashboardHeader and DashboardShell) on the client side while the users' data is still being fetched.
Here's a brief overview of my setup:
My question is: Is there a way to initiate data prefetching server-side in layout.tsx, make it available across all subpages, and simultaneously allow for dynamic client-side loading of the dashboard layout components? I haven't found a solid approach to achieve this without compromising either client-side loading or maintaining a consistent suspense across all subsequent pages. Ideally, I'd like the prefetch to start, dashboard components to load immediately, and Suspense to wait until the data is ready before streaming it to the user.
I would be happy about any help. Thank you 😊🙏🏽
Here is my code:
Beta Was this translation helpful? Give feedback.
All reactions