braid-design-system
Version:
Themeable design system for the SEEK Group
14 lines (13 loc) • 569 B
JavaScript
const REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
const LEGACY_REACT_ELEMENT_TYPE = Symbol.for("react.element");
const REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
const isReactElementType = (value) => {
if (typeof value !== "object" || value === null) {
return false;
}
const $$typeof = value.$$typeof;
return $$typeof === REACT_ELEMENT_TYPE || $$typeof === LEGACY_REACT_ELEMENT_TYPE;
};
const isFragment = (value) => isReactElementType(value) && value.type === REACT_FRAGMENT_TYPE;
exports.isFragment = isFragment;
;