UNPKG

@uimkit/uikit-react

Version:

<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>

21 lines (18 loc) 816 B
import React__default, { useContext } from 'react'; import '../types/models.js'; import '../types/events.js'; var UIKitContext = React__default.createContext(undefined); function UIKitProvider(_a) { var value = _a.value, children = _a.children; return (React__default.createElement(UIKitContext.Provider, { value: value }, children)); } var useUIKit = function (componentName) { var context = 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; }; export { UIKitProvider, useUIKit }; //# sourceMappingURL=UIKitContext.js.map