Skip to content

Commit

Permalink
remove unnecessary ReactDOM.renderToString operation (#5218)
Browse files Browse the repository at this point in the history
* remove useless `ReactDOM.renderToString` operation

* chore: add changeset
  • Loading branch information
MoustaphaDev authored Oct 28, 2022
1 parent 25a6360 commit 0b12414
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tasty-rules-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/react': patch
---

remove unnecessary `ReactDOM.renderToString` operation
1 change: 0 additions & 1 deletion packages/integrations/react/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0b12414

Please sign in to comment.