Skip to content

Async React.renderToString for server-side rendering #3793

@xpepermint

Description

@xpepermint

It would really help if we could use the async version of the React.renderToString when rendering on the server-side.

app.get('*', function (req, res) {

  Router.run(routes, req.path, (Handler, router) => {
    // var content = React.renderToString(<Handler/>);
    // res.render('index', { content: content });
    React.renderToString(<Handler/>, function(content) {
      res.render('index', { content: content });
    });
});

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