UNPKG

@botonic/react

Version:

Build Chatbots using React

21 lines 619 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getElementName = getElementName; exports.getComponentTypeName = getComponentTypeName; /** * Get the name of an element (instantiated component) * @param {React.Element} component * @returns {string} */ function getElementName(component) { return component.type.name; } /** * Get the name of a component TYPE * @param {React.ComponentType} component * @returns {string} */ function getComponentTypeName(component) { return component.displayName || component.name || 'Component'; } //# sourceMappingURL=components.js.map