test-container.tsx 640 B

123456789101112131415161718
  1. import { FC, ComponentProps, PropsWithChildren, Suspense } from 'react'
  2. import { withTestContainerErrorBoundary } from '../../../helpers/error-boundary'
  3. const style = { width: 785, height: 785 }
  4. const TestContainerWithoutErrorBoundary: FC<
  5. PropsWithChildren<ComponentProps<'div'>>
  6. > = ({ children, ...rest }) => (
  7. <div style={style} {...rest}>
  8. <Suspense fallback={null}>{children}</Suspense>
  9. </div>
  10. )
  11. // react-error-boundary version 5 requires an error boundary when using
  12. // useErrorBoundary, which we do in several components
  13. export const TestContainer = withTestContainerErrorBoundary(
  14. TestContainerWithoutErrorBoundary
  15. )