remove unnecessary ReactDOM.renderToString operation (#5218)

* remove useless `ReactDOM.renderToString` operation

* chore: add changeset
This commit is contained in:
Happydev 2022-10-28 02:05:18 +00:00 committed by GitHub
parent 25a6360a60
commit 0b12414315
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/react': patch
---
remove unnecessary `ReactDOM.renderToString` operation

View file

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