@razorpay/blade
Version:
The Design System that powers Razorpay
21 lines (18 loc) • 729 B
JavaScript
import { createContext, useContext } from 'react';
import '../../utils/logger/index.js';
import { throwBladeError } from '../../utils/logger/logger.js';
var CollapsibleContext = /*#__PURE__*/createContext(null);
var useCollapsible = function useCollapsible() {
var collapsibleContext = useContext(CollapsibleContext);
if (false) {
if (!collapsibleContext) {
throwBladeError({
message: "You're trying to use Collapsible sub-components without Collapsible. useCollapsible should only be used within CollapsibleContext",
moduleName: 'CollapsibleContext'
});
}
}
return collapsibleContext;
};
export { CollapsibleContext, useCollapsible };
//# sourceMappingURL=CollapsibleContext.js.map