UNPKG

@gravity-ui/uikit

Version:

Gravity UI base styling and components

23 lines (22 loc) 737 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isOfType = isOfType; const tslib_1 = require("tslib"); const React = tslib_1.__importStar(require("react")); function isOfType(Component) { return function isMatching(component) { if (!React.isValidElement(component)) { return false; } const { type } = component; if (type === Component) { return true; } if (typeof Component === 'string' || typeof type === 'string') { return false; } const displayName = type.displayName; return Boolean(displayName && displayName === Component.displayName); }; } //# sourceMappingURL=isOfType.js.map