Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
🏷️ Fix TS type in ErrorBoundary
Browse files Browse the repository at this point in the history
  • Loading branch information
cermakjiri committed Oct 25, 2021
1 parent f9edbff commit 8036f2e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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<SentryErrorBoundaryProps, 'fallback' | 'onError'> {
children: ReactNode;
fallback?: ReactNode;
onError?: (error: Error, info: { componentStack: string }) => void;
}

const defaultFallback = <ErrorMessage />;
Expand Down

0 comments on commit 8036f2e

Please sign in to comment.