mirror of
https://github.com/resend/react-email.git
synced 2026-09-14 14:18:02 +08:00
fix(render): new ErrorBoundary breaking rendering in server components (#2871)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@react-email/render": patch
|
||||
---
|
||||
|
||||
fix ErrorBoundary breaking server rendering
|
||||
+5
@@ -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;
|
||||
}> {
|
||||
Reference in New Issue
Block a user