@@ -15,7 +15,7 @@ export function isAtLeastReact17(version: string): boolean {
1515export  const  UNKNOWN_COMPONENT  =  'unknown' ; 
1616
1717export  type  FallbackRender  =  ( errorData : { 
18-   error : Error ; 
18+   error : unknown ; 
1919  componentStack : string ; 
2020  eventId : string ; 
2121  resetError ( ) : void ; 
@@ -40,15 +40,15 @@ export type ErrorBoundaryProps = {
4040   */ 
4141  fallback ?: React . ReactElement  |  FallbackRender  |  undefined ; 
4242  /** Called when the error boundary encounters an error */ 
43-   onError ?: ( ( error : Error ,  componentStack : string ,  eventId : string )  =>  void )  |  undefined ; 
43+   onError ?: ( ( error : unknown ,  componentStack : string ,  eventId : string )  =>  void )  |  undefined ; 
4444  /** Called on componentDidMount() */ 
4545  onMount ?: ( ( )  =>  void )  |  undefined ; 
4646  /** Called if resetError() is called from the fallback render props function  */ 
47-   onReset ?: ( ( error : Error   |   null ,  componentStack : string  |  null ,  eventId : string  |  null )  =>  void )  |  undefined ; 
47+   onReset ?: ( ( error : unknown ,  componentStack : string  |  null ,  eventId : string  |  null )  =>  void )  |  undefined ; 
4848  /** Called on componentWillUnmount() */ 
49-   onUnmount ?: ( ( error : Error   |   null ,  componentStack : string  |  null ,  eventId : string  |  null )  =>  void )  |  undefined ; 
49+   onUnmount ?: ( ( error : unknown ,  componentStack : string  |  null ,  eventId : string  |  null )  =>  void )  |  undefined ; 
5050  /** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */ 
51-   beforeCapture ?: ( ( scope : Scope ,  error : Error   |   null ,  componentStack : string  |  null )  =>  void )  |  undefined ; 
51+   beforeCapture ?: ( ( scope : Scope ,  error : unknown ,  componentStack : string  |  undefined )  =>  void )  |  undefined ; 
5252} ; 
5353
5454type  ErrorBoundaryState  = 
@@ -59,7 +59,7 @@ type ErrorBoundaryState =
5959    } 
6060  |  { 
6161      componentStack : React . ErrorInfo [ 'componentStack' ] ; 
62-       error : Error ; 
62+       error : unknown ; 
6363      eventId : string ; 
6464    } ; 
6565
@@ -118,7 +118,7 @@ class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundarySta
118118    } 
119119  } 
120120
121-   public  componentDidCatch ( error : Error   &   {   cause ?:  Error   } ,  {  componentStack } : React . ErrorInfo ) : void { 
121+   public  componentDidCatch ( error : unknown ,  {  componentStack } : React . ErrorInfo ) : void { 
122122    const  {  beforeCapture,  onError,  showDialog,  dialogOptions }  =  this . props ; 
123123    withScope ( scope  =>  { 
124124      // If on React version >= 17, create stack trace from componentStack param and links 
@@ -200,9 +200,9 @@ class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundarySta
200200      if  ( typeof  fallback  ===  'function' )  { 
201201        element  =  React . createElement ( fallback ,  { 
202202          error : state . error , 
203-           componentStack : state . componentStack , 
203+           componentStack : state . componentStack   as   string , 
204204          resetError : this . resetErrorBoundary , 
205-           eventId : state . eventId , 
205+           eventId : state . eventId   as   string , 
206206        } ) ; 
207207      }  else  { 
208208        element  =  fallback ; 
0 commit comments