Initial commit for homaroma
This commit is contained in:
commit
f2179cfe57
269 files changed
+22635
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
|
||||
/**
|
||||
* Scrolls window to top on every route change.
|
||||
* Place this inside <BrowserRouter> so it has access to location context.
|
||||
*/
|
||||
export default function ScrollToTop() {
|
||||
const { pathname } = useLocation()
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo({ top: 0, behavior: 'instant' })
|
||||
}, [pathname])
|
||||
|
||||
return null
|
||||
}
|
||||
Reference in new issue
Block a user