mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 14:00:05 +02:00

Upgrade react-error-boundary to version 5, second attempt GitOrigin-RevId: 2b88334b66f0ace383211c147279ff88e9f956bb
18 lines
640 B
TypeScript
18 lines
640 B
TypeScript
import { FC, ComponentProps, PropsWithChildren, Suspense } from 'react'
|
|
import { withTestContainerErrorBoundary } from '../../../helpers/error-boundary'
|
|
|
|
const style = { width: 785, height: 785 }
|
|
|
|
const TestContainerWithoutErrorBoundary: FC<
|
|
PropsWithChildren<ComponentProps<'div'>>
|
|
> = ({ children, ...rest }) => (
|
|
<div style={style} {...rest}>
|
|
<Suspense fallback={null}>{children}</Suspense>
|
|
</div>
|
|
)
|
|
|
|
// react-error-boundary version 5 requires an error boundary when using
|
|
// useErrorBoundary, which we do in several components
|
|
export const TestContainer = withTestContainerErrorBoundary(
|
|
TestContainerWithoutErrorBoundary
|
|
)
|