UNPKG

@liveblocks/react-ui

Version:

A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.

42 lines (38 loc) 1.1 kB
"use client"; import { jsx } from 'react/jsx-runtime'; import { createContext, useContext, useMemo } from 'react'; import { ComponentsProvider } from './components.js'; import { OverridesProvider } from './overrides.js'; const LiveblocksUIConfigContext = createContext({}); function useLiveblocksUIConfig() { return useContext(LiveblocksUIConfigContext); } function LiveblocksUIConfig({ overrides, components, portalContainer, preventUnsavedComposerChanges = true, emojibaseUrl, children }) { const liveblocksUIConfig = useMemo( () => ({ portalContainer, preventUnsavedComposerChanges, emojibaseUrl }), [portalContainer, preventUnsavedComposerChanges, emojibaseUrl] ); return /* @__PURE__ */ jsx(LiveblocksUIConfigContext.Provider, { value: liveblocksUIConfig, children: /* @__PURE__ */ jsx(OverridesProvider, { overrides, children: /* @__PURE__ */ jsx(ComponentsProvider, { components, children }) }) }); } export { LiveblocksUIConfig, useLiveblocksUIConfig }; //# sourceMappingURL=config.js.map