Skip to content

Commit fd546a5

Browse files
committed
Add typescript definitions
1 parent df1ac62 commit fd546a5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

index.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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>{}

0 commit comments

Comments
 (0)