diff --git a/src/hooks/ScrollToTop.tsx b/src/hooks/ScrollToTop.tsx deleted file mode 100644 index 1f720d7..0000000 --- a/src/hooks/ScrollToTop.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { useEffect } from 'react'; -import { useRouter } from 'next/router'; - -export function ScrollToTop() { - const router = useRouter(); - - useEffect(() => { - const handleRouteChange = () => { - window.scrollTo(0, 0); - }; - router.events.on('routeChangeComplete', handleRouteChange); - - return () => { - router.events.off('routeChangeComplete', handleRouteChange); - }; - }, [router.events]); - - return null; -} diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 3ffc027..92f170c 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,2 +1 @@ -export * from './ScrollToTop'; export * from './useStateContext';