File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,10 @@ export class ErrorBoundary extends Component<
21
21
PropsWithRef < PropsWithChildren < ErrorBoundaryProps > > ,
22
22
ErrorBoundaryState
23
23
> {
24
- constructor ( props : ErrorBoundaryProps ) {
24
+ constructor ( props : ErrorBoundaryProps ) {
25
25
super ( props ) ;
26
+
27
+ this . resetErrorBoundary = this . resetErrorBoundary . bind ( this ) ;
26
28
this . state = initialState ;
27
29
}
28
30
@@ -41,7 +43,7 @@ export class ErrorBoundary extends Component<
41
43
42
44
this . setState ( initialState ) ;
43
45
}
44
- } ;
46
+ }
45
47
46
48
componentDidCatch ( error : Error , info : ErrorInfo ) {
47
49
this . props . onError ?.( error , info ) ;
@@ -84,7 +86,7 @@ export class ErrorBoundary extends Component<
84
86
if ( didCatch ) {
85
87
const props : FallbackProps = {
86
88
error,
87
- resetErrorBoundary : this . resetErrorBoundary . bind ( this ) ,
89
+ resetErrorBoundary : this . resetErrorBoundary ,
88
90
} ;
89
91
90
92
if ( isValidElement ( fallback ) ) {
@@ -106,7 +108,7 @@ export class ErrorBoundary extends Component<
106
108
value : {
107
109
didCatch,
108
110
error,
109
- resetErrorBoundary : this . resetErrorBoundary . bind ( this ) ,
111
+ resetErrorBoundary : this . resetErrorBoundary ,
110
112
} ,
111
113
} ,
112
114
childToRender
You can’t perform that action at this time.
0 commit comments