Skip to content

Commit 58ebdc0

Browse files
authored
Merge pull request #20 from Yasar2019/copilot/initialize-backtotop-visibility-on-mount
Initialize BackToTop visibility on mount
2 parents 754b0c8 + bc8588c commit 58ebdc0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Components/BackToTop.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const BackToTop = () => {
4040
setVisible(window.scrollY > 400);
4141
};
4242
window.addEventListener("scroll", handleScroll, { passive: true });
43+
handleScroll();
4344
return () => window.removeEventListener("scroll", handleScroll);
4445
}, []);
4546

0 commit comments

Comments
 (0)