Skip to content

Commit b573838

Browse files
committed
fix add function getDisplayName
1 parent 42abc78 commit b573838

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ErrorBoundary.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ class ErrorBoundary extends Component<Props, State> {
6363
}
6464
}
6565

66+
67+
function getDisplayName(WrappedComponent) {
68+
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
69+
}
70+
6671
export const withErrorBoundary = (
6772
Component: ComponentType<any>,
6873
FallbackComponent: ComponentType<any>,

0 commit comments

Comments
 (0)