diff --git a/src/layouts/layout/layout.tsx b/src/layouts/layout/layout.tsx index 63ab51be..87c85325 100644 --- a/src/layouts/layout/layout.tsx +++ b/src/layouts/layout/layout.tsx @@ -9,12 +9,11 @@ type LayoutProps = { }; const Layout: React.FC = ({ children }) => { - const location = useLocation(); - const page = location.pathname; + const { pathname } = useLocation(); useEffect(() => { window.scrollTo(0, 0); - }, [page]); + }, [pathname]); return (