@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
22 lines • 1.13 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useGenericComponents = exports.GenericComponentsProvider = exports.GenericComponentContext = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = __importDefault(require("react"));
exports.GenericComponentContext = react_1.default.createContext(null);
const GenericComponentsProvider = ({ children, value, }) => {
return ((0, jsx_runtime_1.jsx)(exports.GenericComponentContext.Provider, { value: value, children: children }));
};
exports.GenericComponentsProvider = GenericComponentsProvider;
const useGenericComponents = () => {
const context = react_1.default.useContext(exports.GenericComponentContext);
if (!context) {
throw Error('Generic components context is being used without a provider or with an unsupported value');
}
return context;
};
exports.useGenericComponents = useGenericComponents;
//# sourceMappingURL=genericComponentsProvider.js.map