File tree Expand file tree Collapse file tree
packages/plugin-rsc/examples/starter/src/framework Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,19 +19,21 @@ export async function renderHTML(
1919 const [ rscStream1 , rscStream2 ] = rscStream . tee ( )
2020
2121 // deserialize RSC stream back to React VDOM
22- let payload : Promise < RscPayload >
22+ let payload : Promise < RscPayload > | undefined
2323 function SsrRoot ( ) {
2424 // deserialization needs to be kicked off inside ReactDOMServer context
2525 // for ReactDomServer preinit/preloading to work
2626 payload ??= ReactClient . createFromReadableStream < RscPayload > ( rscStream1 )
2727 const root = React . use ( payload ) . root
28- return < SsrUseWorkaround > { root } </ SsrUseWorkaround >
28+ return < FixSsrThenable > { root } </ FixSsrThenable >
2929 }
3030
31- // Add an empty component in between SsrRoot and user's root to avoid React SSR bugs.
32- // > SsrRoot (use) -> SsrUseWorkaround -> root (which potentially has `lazy` + `use`)
31+ // Add an empty component in between `SsrRoot` and user `root` to avoid React SSR bugs.
32+ // SsrRoot (use)
33+ // => FixSsrThenable
34+ // => root (which potentially has `lazy` + `use`)
3335 // https://github.com/facebook/react/issues/33937#issuecomment-3091349011
34- function SsrUseWorkaround ( props : React . PropsWithChildren ) {
36+ function FixSsrThenable ( props : React . PropsWithChildren ) {
3537 return props . children
3638 }
3739
You can’t perform that action at this time.
0 commit comments