We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4ddebc commit 47835eeCopy full SHA for 47835ee
1 file changed
app/hooks/use-scroll-restoration.ts
@@ -10,7 +10,7 @@ import { useLocation, useNavigation } from 'react-router-dom'
10
11
function getScrollPosition(key: string) {
12
const pos = window.sessionStorage.getItem(key)
13
- return pos && /^[0-9]+$/.test(pos) ? parseInt(pos, 10) : 0
+ return Number(pos) || 0
14
}
15
16
function setScrollPosition(key: string, pos: number) {
0 commit comments