Skip to content

Commit

Permalink
fix(render): remove destructuring of react-dom/server import (#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmfern committed Nov 13, 2024
1 parent f6d9e74 commit e22559e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-beans-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-email/render": patch
---

Remove uncessary destructuring of react-dom/server
2 changes: 1 addition & 1 deletion packages/render/src/browser/render-async.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const renderAsync = async (
options?: Options,
) => {
const suspendedElement = <Suspense>{element}</Suspense>;
const { default: reactDOMServer } = await import("react-dom/server");
const reactDOMServer = await import("react-dom/server");

let html!: string;
if (Object.hasOwn(reactDOMServer, "renderToReadableStream")) {
Expand Down
2 changes: 1 addition & 1 deletion packages/render/src/browser/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const render = async (
options?: Options,
) => {
const suspendedElement = <Suspense>{element}</Suspense>;
const { default: reactDOMServer } = await import("react-dom/server");
const reactDOMServer = await import("react-dom/server");

let html!: string;
if (Object.hasOwn(reactDOMServer, "renderToReadableStream")) {
Expand Down
2 changes: 1 addition & 1 deletion packages/render/src/node/render-async.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const renderAsync = async (
options?: Options,
) => {
const suspendedElement = <Suspense>{element}</Suspense>;
const { default: reactDOMServer } = await import("react-dom/server");
const reactDOMServer = await import("react-dom/server");

let html!: string;
if (Object.hasOwn(reactDOMServer, "renderToReadableStream")) {
Expand Down
2 changes: 1 addition & 1 deletion packages/render/src/node/render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const render = async (
options?: Options,
) => {
const suspendedElement = <Suspense>{element}</Suspense>;
const { default: reactDOMServer } = await import("react-dom/server");
const reactDOMServer = await import("react-dom/server");

let html!: string;
if (Object.hasOwn(reactDOMServer, "renderToReadableStream")) {
Expand Down

0 comments on commit e22559e

Please sign in to comment.