Skip to content

Commit 7489466

Browse files
fix: propagate original error
1 parent 13d5cf7 commit 7489466

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ErrorBoundary.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ export class ErrorBoundary extends Component<
8888
} else if (FallbackComponent) {
8989
childToRender = createElement(FallbackComponent, props);
9090
} else {
91-
throw new Error(
91+
console.error(
9292
"react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop"
9393
);
94+
throw error;
9495
}
9596
}
9697

0 commit comments

Comments
 (0)