From 8036f2e47cc876f7eeb8e7979a6d3116cd119797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C4=8Cerm=C3=A1k?= Date: Mon, 25 Oct 2021 16:28:08 +0200 Subject: [PATCH] :label: Fix TS type in ErrorBoundary --- .../errors/components/ErrorBoundary/ErrorBoundary.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/cra-template-typescript/template/src/modules/errors/components/ErrorBoundary/ErrorBoundary.tsx b/packages/cra-template-typescript/template/src/modules/errors/components/ErrorBoundary/ErrorBoundary.tsx index 3834efdd1e8..051dfb68d0f 100644 --- a/packages/cra-template-typescript/template/src/modules/errors/components/ErrorBoundary/ErrorBoundary.tsx +++ b/packages/cra-template-typescript/template/src/modules/errors/components/ErrorBoundary/ErrorBoundary.tsx @@ -1,18 +1,17 @@ import React from 'react'; import type { ReactNode } from 'react'; import { ErrorBoundary as SentryErrorBoundary } from '@sentry/react'; +import type { ErrorBoundaryProps as SentryErrorBoundaryProps } from '@sentry/react/esm/errorboundary'; import * as Log from 'config/loglevel'; import ErrorMessage from '../ErrorMessage'; -const handleError = (error, { componentStack }) => { +const handleError: SentryErrorBoundaryProps['onError'] = (error, componentStack) => { Log.error(error, componentStack); }; -interface ErrorBoundaryProps { +interface ErrorBoundaryProps extends Pick { children: ReactNode; - fallback?: ReactNode; - onError?: (error: Error, info: { componentStack: string }) => void; } const defaultFallback = ;