Skip to content

Commit 7cfba84

Browse files
committed
fix: change deprecated pageYOffset to scrollY in BackToTopButton
1 parent 976c901 commit 7cfba84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/buttons/BackToTopButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const BackToTopButton = () => {
66

77
useEffect(() => {
88
const toggleVisibility = () => {
9-
if (window.pageYOffset > 300) {
9+
if (window.scrollY > 300) {
1010
setIsVisible(true)
1111
} else {
1212
setIsVisible(false)

0 commit comments

Comments
 (0)