Unverified Commit 6cbe40fb authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[dev-overlay] Remove unnecessary code from /pages dev error boundary (#79983)

No longer needed in React 18+
parent 002fb28e
......@@ -15,10 +15,6 @@ export class PagesDevOverlayErrorBoundary extends React.PureComponent<
return { error }
}
componentDidCatch(error: Error) {
this.setState({ error })
}
// Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.
render(): React.ReactNode {
// The component has to be unmounted or else it would continue to error
......
......@@ -17,9 +17,7 @@ export function PagesDevOverlay({ children }: PagesDevOverlayProps) {
return (
<>
<PagesDevOverlayErrorBoundary>
{children ?? null}
</PagesDevOverlayErrorBoundary>
<PagesDevOverlayErrorBoundary>{children}</PagesDevOverlayErrorBoundary>
{/* Fonts can only be loaded outside the Shadow DOM. */}
<FontStyles />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment