Retrieves the name of a React component.
Argument | Type | Description |
---|---|---|
Component |
React.Component |
A React component. |
string
: The name of a React component.
import React from 'react'
import getComponentName from '@helpscout/react-utils/dist/getComponentName'
class UncleRico extends React.Component {
...
}
getComponentName(UncleRico)
// UncleRico