File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/components/ErrorBoundary Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
- export type ErrorBoundaryState = {
3
+ export interface ErrorBoundaryState {
4
4
error : Error | null ;
5
5
errorInfo : React . ErrorInfo | null ;
6
- } ;
6
+ }
7
7
8
- type FallbackProps = ErrorBoundaryState ;
8
+ interface FallbackProps {
9
+ error : Error ;
10
+ errorInfo : React . ErrorInfo ;
11
+ }
9
12
10
13
export type ErrorBoundaryProps = {
11
14
FallbackComponent ?: React . ComponentType < FallbackProps > ;
@@ -39,7 +42,7 @@ export class ErrorBoundary extends React.Component<
39
42
40
43
if ( errorInfo ) {
41
44
if ( FallbackComponent ) {
42
- return < FallbackComponent error = { error } errorInfo = { errorInfo } { ...rest } /> ;
45
+ return < FallbackComponent error = { error ! } errorInfo = { errorInfo } { ...rest } /> ;
43
46
}
44
47
45
48
return null ;
You can’t perform that action at this time.
0 commit comments