How does Next.js receive and hydrate streamed components on the client?
Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
Cuvier’s Dwarf CaimanOP
We can use async components on the server with
Next.js use RSC Payload, how to do the same in a vanilla react project?
Suspense
to show a loading UI while the data is being fetched, and this works well with renderToPipeableStream
. However, on the client, we need to hydrate the streamed HTML using hydrateRoot
. The problem is, we can't import a server component on the client since it's not valid there. So what should we pass as the React element parameter to hydrateRoot
in this case?Next.js use RSC Payload, how to do the same in a vanilla react project?