UNPKG

@ra-libs/react-rbac

Version:

React admin RBAC front components and utils

16 lines 672 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CASLConsumer = CASLConsumer; const tslib_1 = require("tslib"); const react_1 = tslib_1.__importDefault(require("react")); const CASLContext_1 = require("./CASLContext"); function CASLConsumer(props) { const { children } = props; return (react_1.default.createElement(CASLContext_1.CASLContext.Consumer, null, (context) => { if (!context) { throw new Error('CASLConsumer can only be used within CASLProvider'); } return react_1.default.createElement(react_1.default.Fragment, null, children); })); } //# sourceMappingURL=CASLConsumer.js.map