UNPKG

@gravity-ui/uikit

Version:

Gravity UI base styling and components

19 lines (18 loc) 582 B
import * as React from 'react'; export 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