The utility for getting display name
npm install @rcp/util.displayname
# or use yarn
yarn add @rcp/util.displayname
import displayName from '@rcp/util.displayname'
class A extends React.Component {}
displayName(A) === 'A'
class Foo extends React.Component {
static displayName = 'FooFoo'
}
displayName(Foo) === 'FooFoo'
The utility for getting display name
component
(React.ComponentType | React.ReactElement<any> | IFunction | string)
Returns string
This library is written and maintained by imcuttle, [email protected].
MIT