Skip to content

Commit eecf6eb

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

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
@@ -16,9 +16,7 @@ export function PagesDevOverlay({ children }: PagesDevOverlayProps) {
1616

1717
return (
1818
<>
19-
<PagesDevOverlayErrorBoundary>
20-
{children ?? null}
21-
</PagesDevOverlayErrorBoundary>
19+
<PagesDevOverlayErrorBoundary>{children}</PagesDevOverlayErrorBoundary>
2220

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

0 commit comments

Comments
 (0)