silverwolf-x/project / packages /next /src /next-devtools /userspace /pages /pages-dev-overlay-error-boundary.tsx
silverwolf-x's picture
download
raw
727 Bytes
import React from 'react'
type PagesDevOverlayErrorBoundaryProps = {
children?: React.ReactNode
}
type PagesDevOverlayErrorBoundaryState = { error: Error | null }
export class PagesDevOverlayErrorBoundary extends React.PureComponent<
PagesDevOverlayErrorBoundaryProps,
PagesDevOverlayErrorBoundaryState
> {
state = { error: null }
static getDerivedStateFromError(error: Error) {
return { 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
return this.state.error ? null : this.props.children
}
}

Xet Storage Details

Size:
727 Bytes
·
Xet hash:
3c4674e33cc2b4938eafc5836d7a3e4302a555b3268a43f95d8b3e80a2d77f8e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.