UNPKG

@cgi-learning-hub/ui

Version:

@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features

32 lines (31 loc) 1.19 kB
import * as l from "react"; import { P as i } from "./index-Sy88PpwE.js"; import { c as a } from "./chainPropTypes-D9lkm76m.js"; function g(n) { var e; return parseInt(l.version, 10) >= 19 ? ((e = n == null ? void 0 : n.props) == null ? void 0 : e.ref) || null : (n == null ? void 0 : n.ref) || null; } function d(n) { const { prototype: e = {} } = n; return !!e.isReactComponent; } function s(n, e, c, f, p) { const o = n[e], u = p || e; if (o == null || // When server-side rendering React doesn't warn either. // This is not an accurate check for SSR. // This is only in place for Emotion compat. // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved. typeof window > "u") return null; let t; const r = o.type; return typeof r == "function" && !d(r) && (t = "Did you accidentally use a plain function component for an element instead?"), t !== void 0 ? new Error(`Invalid ${f} \`${u}\` supplied to \`${c}\`. Expected an element that can hold a ref. ${t} For more information see https://mui.com/r/caveat-with-refs-guide`) : null; } const m = a(i.element, s); m.isRequired = a(i.element.isRequired, s); export { m as e, g };