diff --git a/src/components/ScrollToTop/ScrollToTop.tsx b/src/components/ScrollToTop/ScrollToTop.tsx index 6861e6b3..99ed8d9c 100644 --- a/src/components/ScrollToTop/ScrollToTop.tsx +++ b/src/components/ScrollToTop/ScrollToTop.tsx @@ -5,7 +5,7 @@ import { useLocation } from 'react-router-dom' * Function that can be called to bring the user's screen to the top of the page. */ export default function ScrollToTop() { - const { pathname } = useLocation() + const { pathname, key } = useLocation() useEffect(() => { window.scrollTo({ @@ -13,7 +13,7 @@ export default function ScrollToTop() { top: 0, behavior: 'instant', }) - }, [pathname]) + }, [pathname, key]) return null }