Remove unused pathname hook

This commit is contained in:
Sam Becker 2025-10-26 10:32:09 -05:00
parent b9c31153f2
commit e114343d1f
3 changed files with 0 additions and 26 deletions

View File

@ -18,7 +18,6 @@ import { SWRKey } from '@/swr';
export type AppStateContextType = {
// CORE
previousPathname?: string
hasLoaded?: boolean
hasLoadedWithAnimations?: boolean
invalidateSwr?: (key?: SWRKey, revalidate?: boolean) => void

View File

@ -9,7 +9,6 @@ import {
} from 'react';
import { AppStateContext } from '../app/AppState';
import { AnimationConfig } from '@/components/AnimateItems';
import usePathnames from '@/utility/usePathnames';
import { getAuthAction } from '@/auth/actions';
import useSWR, { useSWRConfig } from 'swr';
import {
@ -53,8 +52,6 @@ export default function AppStateProvider({
const pathname = usePathname();
const { previousPathname } = usePathnames();
// CORE
const [hasLoaded, setHasLoaded] =
useState(false);
@ -222,7 +219,6 @@ export default function AppStateProvider({
<AppStateContext.Provider
value={{
// CORE
previousPathname,
hasLoaded,
hasLoadedWithAnimations,
invalidateSwr,

View File

@ -1,21 +0,0 @@
import { useEffect, useRef } from 'react';
import { usePathname } from 'next/navigation';
const usePathnames = () => {
const pathname = usePathname();
const currentRef = useRef('');
const previousRef = useRef('');
useEffect(() => {
previousRef.current = currentRef.current;
currentRef.current = pathname;
}, [pathname]);
return {
currentPathname: currentRef.current,
previousPathname: previousRef.current,
};
};
export default usePathnames;