mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
9 lines
262 B
TypeScript
9 lines
262 B
TypeScript
// Attempts to get a display name from a Component
|
|
//
|
|
// Use for HoCs
|
|
export default function getDisplayName<Props = {}>(
|
|
WrappedComponent: React.ComponentType<Props>
|
|
): string {
|
|
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
}
|