Skip to content

Commit 7dcc79d

Browse files
authored
chore: upgrade react-error-boundary to 6.1.0 (#12)
1 parent 7b287cf commit 7dcc79d

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

packages/static/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"dependencies": {
4848
"@vitejs/plugin-rsc": "^0.5.14",
49-
"react-error-boundary": "^6.0.3",
49+
"react-error-boundary": "^6.1.0",
5050
"rsc-html-stream": "^0.0.7",
5151
"srvx": "^0.10.0"
5252
},

packages/static/src/client/error-boundary.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import React, { startTransition } from "react";
4-
import { ErrorBoundary } from "react-error-boundary";
4+
import { ErrorBoundary, type FallbackProps } from "react-error-boundary";
55

66
/**
77
* Whole-page error boundary for unexpected errors during development
@@ -14,12 +14,8 @@ export const GlobalErrorBoundary: React.FC<React.PropsWithChildren> = (
1414
);
1515
};
1616

17-
interface FallbackProps {
18-
error: Error;
19-
resetErrorBoundary: () => void;
20-
}
21-
2217
const Fallback: React.FC<FallbackProps> = ({ error, resetErrorBoundary }) => {
18+
const errorMessage = error instanceof Error ? error.message : String(error);
2319
return (
2420
<html>
2521
<head>
@@ -39,7 +35,7 @@ const Fallback: React.FC<FallbackProps> = ({ error, resetErrorBoundary }) => {
3935
>
4036
<h1>Caught an unexpected error</h1>
4137
<p>See the console for details.</p>
42-
<pre>Error: {error.message}</pre>
38+
<pre>Error: {errorMessage}</pre>
4339
<button
4440
onClick={() => {
4541
startTransition(() => {

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)