Skip to content

Commit 42d76f5

Browse files
committed
docs(demo): Remove react-error-boundary pkg
1 parent 6815c94 commit 42d76f5

File tree

4 files changed

+20
-30
lines changed

4 files changed

+20
-30
lines changed

examples/github-app/package-lock.json

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

examples/github-app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
"parse-link-header": "^2.0.0",
6363
"react": "19.1.0",
6464
"react-dom": "19.1.0",
65-
"react-error-boundary": "^5.0.0",
6665
"react-markdown": "10.1.0",
6766
"rehype-highlight": "7.0.2",
6867
"remark-gfm": "^4.0.0",

examples/github-app/src/RootProvider.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import {
55
getDefaultManagers,
66
ProviderProps,
77
} from '@data-client/react';
8+
import { ErrorBoundary } from '@data-client/react';
89
import type { ReactNode } from 'react';
9-
import { ErrorBoundary } from 'react-error-boundary';
10-
import type { FallbackProps } from 'react-error-boundary';
1110

1211
import { AuthdProvider } from '@/navigation/authdContext';
1312
import { unAuth } from '@/resources/Auth';
@@ -27,11 +26,11 @@ const managers = [
2726

2827
export default function RootProvider({ children, ...rest }: Props) {
2928
return (
30-
<ErrorBoundary FallbackComponent={ErrorFallback}>
29+
<ErrorBoundary fallbackComponent={ErrorFallback}>
3130
<DataProvider {...rest} managers={managers}>
3231
<Router>
3332
<AuthdProvider>
34-
<ErrorBoundary FallbackComponent={ErrorFallback}>
33+
<ErrorBoundary fallbackComponent={ErrorFallback}>
3534
<Boundary>{children}</Boundary>
3635
</ErrorBoundary>
3736
</AuthdProvider>
@@ -43,7 +42,14 @@ export default function RootProvider({ children, ...rest }: Props) {
4342

4443
type Props = { children: ReactNode } & ProviderProps;
4544

46-
function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
45+
function ErrorFallback({
46+
error,
47+
resetErrorBoundary,
48+
}: {
49+
error: Error;
50+
resetErrorBoundary: () => void;
51+
className?: string;
52+
}) {
4753
return (
4854
<div role="alert">
4955
<p>Something went wrong:</p>

examples/github-app/src/pages/IssueDetail/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Link } from '@anansi/router';
22
import { useSuspense, useCache, useDLE } from '@data-client/react';
3+
import { ErrorBoundary } from '@data-client/react';
34
import { Card, Avatar } from 'antd';
45
import { Tag } from 'antd';
56
import React, { useMemo, memo, type JSX } from 'react';
6-
import { ErrorBoundary } from 'react-error-boundary';
77
import Markdown from 'react-markdown';
88
import rehypeHighlight from 'rehype-highlight';
99
import remarkGfm from 'remark-gfm';
@@ -53,7 +53,7 @@ function IssueDetail({ number, repo, owner }: Props) {
5353
}
5454
description={
5555
<ErrorBoundary
56-
fallbackRender={({ error }) => <div>{error.message}</div>}
56+
fallbackComponent={({ error }) => <div>{error.message}</div>}
5757
>
5858
<Markdown
5959
remarkPlugins={[remarkRemoveComments, remarkGfm]}

0 commit comments

Comments
 (0)