mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2025-08-28 21:49:24 +00:00
12 lines
237 B
TypeScript
12 lines
237 B
TypeScript
![]() |
import { useEffect } from 'react';
|
||
|
import { useLocation } from 'react-router-dom';
|
||
|
|
||
|
export function ScrollToTop() {
|
||
|
const { pathname } = useLocation();
|
||
|
|
||
|
useEffect(() => {
|
||
|
window.scrollTo(0, 0);
|
||
|
}, [pathname]);
|
||
|
|
||
|
return null;
|
||
|
}
|