remove nav listener on unmount

This commit is contained in:
Tom Heaton
2024-06-06 00:46:46 +01:00
parent 77da5694bb
commit 447bb82e2f
5 changed files with 17 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ export default function ScrollToTop() {
const { pathname } = useLocation();
useEffect(() => {
window.scrollTo(0, 0, {});
window.scrollTo(0, 0, { behavior: "smooth" });
}, [pathname]);
return null;