UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

20 lines (19 loc) 599 B
// src/context/cerberus.tsx import { createContext, useContext } from "react"; import { jsx } from "react/jsx-runtime"; var CerberusContext = createContext(null); function CerberusProvider(props) { return /* @__PURE__ */ jsx(CerberusContext.Provider, { value: props.config, children: props.children }); } function useCerberusContext() { const context = useContext(CerberusContext); if (!context) { throw new Error("useCerberus must be used within a CerberusProvider"); } return context; } export { CerberusProvider, useCerberusContext }; //# sourceMappingURL=chunk-GITT5645.js.map