Skip to content

Commit 2461a26

Browse files
committed
Opt out from default useEffect behavior
1 parent 48b7d9b commit 2461a26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function useWindowScrollPosition(options) {
4242
return () => {
4343
window.removeEventListener('scroll', handleScroll)
4444
}
45-
})
45+
}, [])
4646

4747
return position
4848
}

0 commit comments

Comments
 (0)