File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/no-explicit-any */
22import { render } from '@testing-library/react' ;
3- import * as React from 'react' ;
43import { useEffect } from 'react' ;
54
65import { 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
Original file line number Diff line number Diff line change 77 showReportDialog ,
88 withScope ,
99} from '@sentry/browser' ;
10- import { Event , Severity } from '@sentry/types' ;
10+ import { Event } from '@sentry/types' ;
1111import { parseSemver } from '@sentry/utils' ;
1212import hoistNonReactStatics from 'hoist-non-react-statics' ;
1313import * 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+ */
6774function captureReactErrorBoundaryError ( error : Error , componentStack : string ) : string {
6875 const errorBoundaryError = new Error ( error . name ) ;
6976 errorBoundaryError . stack = componentStack ;
You can’t perform that action at this time.
0 commit comments