made event listener passive

This commit is contained in:
ingawei 2022-09-29 23:40:48 -07:00
parent 4178d3fd22
commit efc04989a8

View File

@ -16,7 +16,7 @@ export function ScrollToTopButton(props: { className?: string }) {
}
useEffect(() => {
window.addEventListener('scroll', onScroll)
window.addEventListener('scroll', onScroll, { passive: true })
return () => {
window.removeEventListener('scroll', onScroll)