fix(render): new ErrorBoundary breaking rendering in server components (#2871)

This commit is contained in:
Gabriel Miranda
2026-01-20 10:13:49 -03:00
committed by GitHub
parent dea6698d15
commit 635dc8f69c
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@react-email/render": patch
---
fix ErrorBoundary breaking server rendering
@@ -1,6 +1,11 @@
import React from 'react';
export function createErrorBoundary(reject: (error: unknown) => void) {
// React Server Components don't support React.Component, so it's just not defined here
if (!React.Component) {
return (props: { children?: React.ReactNode }) => <>{props.children}</>;
}
return class ErrorBoundary extends React.Component<{
children: React.ReactNode;
}> {