Files
spacedrive/interface/app/$libraryId/Layout/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
408 B
TypeScript

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