File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 3
3
createElement ,
4
4
ErrorInfo ,
5
5
isValidElement ,
6
- PropsWithChildren ,
7
6
PropsWithRef ,
8
- ReactElement ,
9
7
} from "react" ;
10
8
import { ErrorBoundaryContext } from "./ErrorBoundaryContext" ;
11
9
import { ErrorBoundaryProps , FallbackProps } from "./types" ;
@@ -18,7 +16,7 @@ const initialState: ErrorBoundaryState = {
18
16
} ;
19
17
20
18
export class ErrorBoundary extends Component <
21
- PropsWithRef < PropsWithChildren < ErrorBoundaryProps > > ,
19
+ PropsWithRef < ErrorBoundaryProps > ,
22
20
ErrorBoundaryState
23
21
> {
24
22
constructor ( props : ErrorBoundaryProps ) {
Original file line number Diff line number Diff line change 2
2
Component ,
3
3
ComponentType ,
4
4
FunctionComponent ,
5
+ PropsWithChildren ,
5
6
ReactElement ,
6
7
ReactNode ,
7
8
} from "react" ;
@@ -13,15 +14,15 @@ export type FallbackProps = {
13
14
resetErrorBoundary : ( ...args : any [ ] ) => void ;
14
15
} ;
15
16
16
- type ErrorBoundarySharedProps = {
17
+ type ErrorBoundarySharedProps = PropsWithChildren < {
17
18
onError ?: ( error : Error , info : { componentStack : string } ) => void ;
18
19
onReset ?: (
19
20
details :
20
21
| { reason : "imperative-api" ; args : any [ ] }
21
22
| { reason : "keys" ; prev : any [ ] | undefined ; next : any [ ] | undefined }
22
23
) => void ;
23
24
resetKeys ?: any [ ] ;
24
- } ;
25
+ } > ;
25
26
26
27
export type ErrorBoundaryPropsWithComponent = ErrorBoundarySharedProps & {
27
28
fallback ?: never ;
You can’t perform that action at this time.
0 commit comments