Scroll to top during navigation changes

This commit is contained in:
Alex Gleason committed 2025-06-01 07:32:33 -05:00
1 parent 98f3305aa1
commit ee42c84171
3 files changed
+20

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
export function ScrollToTop() {
const { pathname } = useLocation();
useEffect(() => {
window.scrollTo(0, 0);
}, [pathname]);
return null;
}