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 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 {