Function that returns
- Component display name if defined
- Function name
- Predefined value, "Component" by default
'use strict'; | |
Object.defineProperty(exports, '__esModule', { value: true }); | |
const getComponentName = ({ name, displayName }, defaultValue = 'Component') => displayName || name || defaultValue; | |
exports.getComponentName = getComponentName; | |
exports.default = getComponentName; |
{ | |
"name": "@actualwave/react-component-name", | |
"description": "Function to get component name", | |
"version": "0.0.1", | |
"main": "index.js", | |
"keywords": [ | |
"react", | |
"component", | |
"function", | |
"name", | |
"displayname" | |
], | |
"author": { | |
"name": "Oleg Galaburda", | |
"email": "burdiuz@gmail.com", | |
"url": "http://actualwave.com/" | |
}, | |
"bugs": { | |
"url": "https://gist.github.com/burdiuz/f35ca68b0da37f7bbed307551a9c175e", | |
"email": "burdiuz@gmail.com" | |
}, | |
"homepage": "https://gist.github.com/burdiuz/f35ca68b0da37f7bbed307551a9c175e", | |
"license": "MIT" | |
} |