Files
spacedrive/interface/app/$libraryId/PageLayout/Context.tsx
Utku fd8c0f87b3 [ENG-1067] Update phosphor to new package & update sort imports (#1330)
* ianvs > trivago

* @phosphor-icons/react > phosphor-react
2023-09-11 15:26:44 +00:00

15 lines
404 B
TypeScript

import { createContext, RefObject, useContext } from 'react';
/**
* Context to hold the ref value of the page layout
*/
export const PageLayoutContext = createContext<{ ref: RefObject<HTMLDivElement> } | null>(null);
export const usePageLayoutContext = () => {
const ctx = useContext(PageLayoutContext);
if (ctx === null) throw new Error('PageLayoutContext.Provider not found!');
return ctx;
};