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": "[email protected]", | |
| "url": "http://actualwave.com/" | |
| }, | |
| "bugs": { | |
| "url": "https://gist.github.com/burdiuz/f35ca68b0da37f7bbed307551a9c175e", | |
| "email": "[email protected]" | |
| }, | |
| "homepage": "https://gist.github.com/burdiuz/f35ca68b0da37f7bbed307551a9c175e", | |
| "license": "MIT" | |
| } |