Skip to content

Commit 67c6de3

Browse files
committed
fix: reset scroll after navigating
1 parent 2b99521 commit 67c6de3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/Layout/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export default function Layout({
2525
document.title = "LNReader";
2626
}
2727
}, [location.pathname]);
28+
useEffect(() => {
29+
window.scrollTo(0, 0);
30+
}, []);
2831
return (
2932
<Box>
3033
<AppBar />

0 commit comments

Comments
 (0)