@uimkit/uikit-react
Version:
<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>
30 lines (23 loc) • 1.12 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
require('../types/models.js');
require('../types/events.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var UIKitContext = React__default["default"].createContext(undefined);
function UIKitProvider(_a) {
var value = _a.value, children = _a.children;
return (React__default["default"].createElement(UIKitContext.Provider, { value: value }, children));
}
var useUIKit = function (componentName) {
var context = React.useContext(UIKitContext);
if (!context) {
console.warn("The useChatContext hook was called outside of the ChatContext provider. Make sure this hook is called within a child of the Chat component. The errored call is located in the ".concat(componentName, " component."));
return {};
}
return context;
};
exports.UIKitProvider = UIKitProvider;
exports.useUIKit = useUIKit;
//# sourceMappingURL=UIKitContext.js.map