Feat(Frontend): Added Routing

This commit is contained in:
2023-07-21 22:37:28 -04:00
parent a73afc90d9
commit 71cb9bdff6
7 changed files with 97 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
import { useEffect } from "react";
import { useLocation } from "react-router";
const ScrollToTop = () => {
const { pathname } = useLocation();
// pathname changes => scroll to top
// scrolling only on navigation
useEffect(() => {
window.scrollTo(0, 0);
}, [pathname]);
return null;
};
export default ScrollToTop;