diff --git a/src/state/AppState.ts b/src/state/AppState.ts index d80ec517..0ce7039e 100644 --- a/src/state/AppState.ts +++ b/src/state/AppState.ts @@ -2,7 +2,7 @@ import { Dispatch, SetStateAction, createContext, - useContext, + use, RefObject, } from 'react'; import { AnimationConfig } from '@/components/AnimateItems'; @@ -12,7 +12,8 @@ import { INITIAL_UPLOAD_STATE, UploadState } from '@/admin/upload'; import { AdminData } from '@/admin/actions'; import { RecipeProps } from '@/recipe'; import { getCountsForCategoriesCachedAction } from '@/category/actions'; -export type AppStateContext = { + +export type AppStateContextType = { // CORE previousPathname?: string hasLoaded?: boolean @@ -73,8 +74,8 @@ export type AppStateContext = { setShouldDebugRecipeOverlays?: Dispatch> } & Partial -export const AppStateContext = createContext({ +export const AppStateContext = createContext({ uploadState: INITIAL_UPLOAD_STATE, }); -export const useAppState = () => useContext(AppStateContext); +export const useAppState = () => use(AppStateContext);