Skip to content

Commit a07aa7a

Browse files
committed
fix(react): align Error Boundary componentStack typing with React.ErrorInfo
1 parent 72751da commit a07aa7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react/src/errorboundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundarySta
9999
public componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void {
100100
const { componentStack } = errorInfo;
101101
// TODO(v9): Remove this check and type `componentStack` to be React.ErrorInfo['componentStack'].
102-
const passedInComponentStack: string | undefined = componentStack == null ? undefined : componentStack;
102+
const passedInComponentStack: React.ErrorInfo['componentStack'] = componentStack || undefined;
103103

104104
const { beforeCapture, onError, showDialog, dialogOptions } = this.props;
105105
withScope(scope => {

0 commit comments

Comments
 (0)