Files
papercrate/frontend/src/appShellContext.ts
T
2025-11-13 01:07:55 +01:00

14 lines
423 B
TypeScript

import React from 'react';
export type AppShellContextValue = Record<string, unknown>;
export const AppShellContext = React.createContext<AppShellContextValue | null>(null);
export const useAppShell = (): AppShellContextValue => {
const context = React.useContext(AppShellContext);
if (!context) {
throw new Error('AppShellContext not found. Ensure routes are nested under AppLayout.');
}
return context;
};