i-darrshan's picture
initial push of the update
8b105ad
raw
history blame
326 Bytes
import React, { useEffect } from "react";
import { useLocation } from "react-router-dom";
const ScrollToTop = () => {
const location = useLocation();
useEffect(() => {
// Scroll to the top of the page when the route changes
window.scrollTo(0, 0);
}, [location]);
return null;
};
export default ScrollToTop;