@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
12 lines (11 loc) • 369 B
JavaScript
import { createContext, use } from "react";
//#region src/base-ui/Tree/context.ts
const TreeContext = createContext(null);
const useTreeContext = () => {
const ctx = use(TreeContext);
if (!ctx) throw new Error("Tree components must be rendered inside <Tree>");
return ctx;
};
//#endregion
export { TreeContext, useTreeContext };
//# sourceMappingURL=context.mjs.map