mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
13 lines
387 B
TypeScript
13 lines
387 B
TypeScript
|
import { useContext } from "react";
|
||
|
// mobx store
|
||
|
import { InstanceContext } from "lib/instance-provider";
|
||
|
// types
|
||
|
import { IInstanceStore } from "store/instance.store";
|
||
|
|
||
|
export const useInstance = (): IInstanceStore => {
|
||
|
const context = useContext(InstanceContext);
|
||
|
if (context === undefined)
|
||
|
throw new Error("useTheme must be used within ThemeProvider");
|
||
|
return context;
|
||
|
};
|