File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+
3
+ export interface FallbackProps {
4
+ error ?: Error ;
5
+ componentStack ?: string ;
6
+ }
7
+
8
+ export interface ErrorBoundaryProps {
9
+ onError ?: ( error : Error , componentStack : string ) => void ;
10
+ FallbackComponent ?: React . ComponentType < FallbackProps > ;
11
+ }
12
+
13
+ export function withErrorBoundary < P > (
14
+ ComponentToDecorate : React . ComponentType < P > ,
15
+ CustomFallbackComponent ?: React . ComponentType < FallbackProps > ,
16
+ onErrorHandler ?: ( error : Error , componentStack : string ) => void ,
17
+ ) : React . ComponentType < P > ;
18
+
19
+ export default class ErrorBoundary extends React . Component < ErrorBoundaryProps > { }
Original file line number Diff line number Diff line change 5
5
"homepage" : " https://github.com/bvaughn/react-error-boundary" ,
6
6
"repository" : " bvaughn/react-error-boundary" ,
7
7
"files" : [
8
- " dist"
8
+ " dist" ,
9
+ " index.d.ts"
9
10
],
10
11
"main" : " dist/commonjs/index.js" ,
11
12
"scripts" : {
You can’t perform that action at this time.
0 commit comments