Merge pull request #25093 from overleaf/td-upgrade-react-error-boundary-second-attempt

Upgrade react-error-boundary to version 5, second attempt

GitOrigin-RevId: 2b88334b66f0ace383211c147279ff88e9f956bb
This commit is contained in:
Tim Down
2025-04-29 08:06:23 +00:00
committed by Copybot
parent d7bd665bee
commit 5d78229e1e
17 changed files with 150 additions and 106 deletions
@@ -1,12 +1,18 @@
import { FC, ComponentProps, Suspense } from 'react'
import { FC, ComponentProps, PropsWithChildren, Suspense } from 'react'
import { withTestContainerErrorBoundary } from '../../../helpers/error-boundary'
const style = { width: 785, height: 785 }
export const TestContainer: FC<ComponentProps<'div'>> = ({
children,
...rest
}) => (
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
)