Skip to content

Commit f5dec77

Browse files
committed
yarn fix
1 parent 7ced5c1 commit f5dec77

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/gatsby/test/integration.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { render } from '@testing-library/react';
3-
import * as React from 'react';
43
import { useEffect } from 'react';
54

65
import { onClientEntry } from '../gatsby-browser';
@@ -15,7 +14,7 @@ describe('useEffect', () => {
1514
let calls = 0;
1615

1716
onClientEntry(undefined, {
18-
beforeSend: event => {
17+
beforeSend: (event: any) => {
1918
expect(event).not.toBeUndefined();
2019
calls += 1;
2120

packages/react/src/errorboundary.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
showReportDialog,
88
withScope,
99
} from '@sentry/browser';
10-
import { Event, Severity } from '@sentry/types';
10+
import { Event } from '@sentry/types';
1111
import { parseSemver } from '@sentry/utils';
1212
import hoistNonReactStatics from 'hoist-non-react-statics';
1313
import * as React from 'react';
@@ -64,6 +64,13 @@ const INITIAL_STATE = {
6464
eventId: null,
6565
};
6666

67+
/**
68+
* Logs react error boundary errors to Sentry. If on React version >= 17, creates stack trace
69+
* from componentStack param, otherwise relies on error param for stacktrace.
70+
*
71+
* @param error An error captured by React Error Boundary
72+
* @param componentStack The component stacktrace
73+
*/
6774
function captureReactErrorBoundaryError(error: Error, componentStack: string): string {
6875
const errorBoundaryError = new Error(error.name);
6976
errorBoundaryError.stack = componentStack;

0 commit comments

Comments
 (0)