Skip to content

Commit fe33b1e

Browse files
committed
[dev-overlay] Remove unnecessary code from /pages dev error boundary
No longer needed in React 18+
1 parent 7120f04 commit fe33b1e

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

packages/next/src/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ export class PagesDevOverlayErrorBoundary extends React.PureComponent<
1515
return { error }
1616
}
1717

18-
componentDidCatch(error: Error) {
19-
this.setState({ error })
20-
}
21-
2218
// Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.
2319
render(): React.ReactNode {
2420
// The component has to be unmounted or else it would continue to error

packages/next/src/client/components/react-dev-overlay/pages/pages-dev-overlay.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ export function PagesDevOverlay({ children }: PagesDevOverlayProps) {
1717

1818
return (
1919
<>
20-
<PagesDevOverlayErrorBoundary>
21-
{children ?? null}
22-
</PagesDevOverlayErrorBoundary>
20+
<PagesDevOverlayErrorBoundary>{children}</PagesDevOverlayErrorBoundary>
2321

2422
{/* Fonts can only be loaded outside the Shadow DOM. */}
2523
<FontStyles />

0 commit comments

Comments
 (0)