File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,12 @@ import { ErrorBoundaryContextType } from "./ErrorBoundaryContext";
2
2
3
3
export function assertErrorBoundaryContext (
4
4
value : any
5
- ) : value is ErrorBoundaryContextType {
5
+ ) : asserts value is ErrorBoundaryContextType {
6
6
if (
7
7
value == null ||
8
8
typeof value . didCatch !== "boolean" ||
9
9
typeof value . resetErrorBoundary !== "function"
10
10
) {
11
11
throw new Error ( "ErrorBoundaryContext not found" ) ;
12
12
}
13
-
14
- return true ;
15
13
}
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export function useErrorBoundary<TError = any>(): UseErrorBoundaryApi<TError> {
24
24
const memoized = useMemo (
25
25
( ) => ( {
26
26
resetBoundary : ( ) => {
27
- context ? .resetErrorBoundary ( ) ;
27
+ context . resetErrorBoundary ( ) ;
28
28
setState ( { error : null , hasError : false } ) ;
29
29
} ,
30
30
showBoundary : ( error : TError ) =>
@@ -33,7 +33,7 @@ export function useErrorBoundary<TError = any>(): UseErrorBoundaryApi<TError> {
33
33
hasError : true ,
34
34
} ) ,
35
35
} ) ,
36
- [ context ? .resetErrorBoundary ]
36
+ [ context . resetErrorBoundary ]
37
37
) ;
38
38
39
39
if ( state . hasError ) {
You can’t perform that action at this time.
0 commit comments