/
concept-collection
/
benchcompress
Jump to
/
Appearance
Match my system
Paper
GitHub
Slate
Midnight
Terminal
Sign in
concept-collection
/
benchcompress
Code
Commits
Issues
0
Pull requests
0
Actions
Branches
2
Tags
0
Site
6967ce5
Branches
main
benchmark-results
benchcompress
/
web-ui
/
src
/
components
/
ScrollToTop.tsx
12 lines · 238 B
Copy
Copied
Blame
History
Raw
1
import
{ useEffect }
from
"react"
;
2
import
{ useLocation }
from
"react-router-dom"
;
3
4
export
function
ScrollToTop
(
) {
5
const
{ pathname } =
useLocation
();
6
7
useEffect
(
() =>
{
8
window
.
scrollTo
(
0
,
0
);
9
}, [pathname]);
10
11
return
null
;
12
}
↑
↓
move
↵
open
esc
close