From 54cb9ffb6f389104c0a016a9b7f32320565c1237 Mon Sep 17 00:00:00 2001 From: Moustapha HappyDev Date: Thu, 27 Oct 2022 18:34:13 +0000 Subject: [PATCH 1/2] remove useless `ReactDOM.renderToString` operation --- packages/integrations/react/server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/integrations/react/server.js b/packages/integrations/react/server.js index 6dd289c994cf..1ebd044cffff 100644 --- a/packages/integrations/react/server.js +++ b/packages/integrations/react/server.js @@ -75,7 +75,6 @@ async function renderToStaticMarkup(Component, props, { default: children, ...sl const vnode = React.createElement(Component, newProps); let html; if (metadata && metadata.hydrate) { - html = ReactDOM.renderToString(vnode); if ('renderToReadableStream' in ReactDOM) { html = await renderToReadableStreamAsync(vnode); } else { From f8799c6229dce49783bd19711f024023d9204b1a Mon Sep 17 00:00:00 2001 From: Moustapha HappyDev Date: Thu, 27 Oct 2022 19:05:37 +0000 Subject: [PATCH 2/2] chore: add changeset --- .changeset/tasty-rules-sleep.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tasty-rules-sleep.md diff --git a/.changeset/tasty-rules-sleep.md b/.changeset/tasty-rules-sleep.md new file mode 100644 index 000000000000..0bc19c626466 --- /dev/null +++ b/.changeset/tasty-rules-sleep.md @@ -0,0 +1,5 @@ +--- +'@astrojs/react': patch +--- + +remove unnecessary `ReactDOM.renderToString` operation