UNPKG

@botonic/react

Version:

Build Chatbots using React

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