Skip to main content

getDisplayName (React)

Get React component display name.

API

function getDisplayName(value: any): string;

Example

import { getDisplayName } from "@lilib/utils";

function Example() {}
Example.displayName = "ExampleComponent";

console.log(getDisplayName(Example));
// => "ExampleComponent"