mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
12 lines
263 B
TypeScript
12 lines
263 B
TypeScript
import type React from 'react';
|
|
|
|
export default function getComponentDisplayName(type: string | React.JSXElementConstructor<unknown>) {
|
|
if (typeof type === 'string') {
|
|
return;
|
|
}
|
|
|
|
if ('displayName' in type) {
|
|
return type.displayName as string;
|
|
}
|
|
}
|