Skip to content

Question:how does react-server achieve stream pre-rendered HTML #1009

@HOUCe

Description

@HOUCe

First of all, many thanks for react-server! It is really amazing!

My question is: how does react-server achieve stream pre-rendered HTML?

I noticed that react-server uses ReactDOMServer.renderToString rather than renderToNodeStream. It seems for me that it is impossible to get stream pre-rendered HTML(I probably get wrong).

I also noticed that you mentioned "react-server has the concept of a RootElement, by RootElement we can get stream pre-rendered HTML". As far as I know, when you use renderToString and get the html string then make a response to client, the request is already finished. (Or use http 2.0 server push?). So how does stream come?

I am new to SSR, and don't know much details about Big-pipe. Please forgive me if the question is strange.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions