Skip to content

Commit

Permalink
Merge pull request #26080 from pasyukevich/migrate-ts/getComponentDis…
Browse files Browse the repository at this point in the history
…playName

[No QA] [TS migration] Migrate 'getComponentDisplayName.js' lib to TypeScript
  • Loading branch information
roryabraham authored Sep 12, 2023
2 parents b7a0046 + ad45628 commit 37feea6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/libs/getComponentDisplayName.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/libs/getComponentDisplayName.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {ComponentType} from 'react';

/** Returns the display name of a component */
export default function getComponentDisplayName(component: ComponentType): string {
return component.displayName ?? component.name ?? 'Component';
}

0 comments on commit 37feea6

Please sign in to comment.