Skip to content

Use renderToPipeableStream instead of renderToString in ssr-react playground #359

@raphael-arce

Description

@raphael-arce

Description

The playground ssr-react uses in the entry-server.jsx the method ReactDOMServer.renderToString which does not support streaming or lazy / suspense components. I'd suggest to replace it with ReactDOMServer.renderToPipeableStream.

Suggested solution

I have made a working example based on the playground (a tiny bit more complex, but in essence the same) here:

https://github.com/technologiestiftung/vite-react-ssg-example/blob/feat/add-streaming-for-suspense/src/entry-server.tsx

If desired, I can make a PR to add these changes. As far as I can tell, nothing else would need to be changed.

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions