diff --git a/components/core/Layout/Layout.tsx b/components/core/Layout/Layout.tsx index 9ac0a74ed..9b04181b6 100644 --- a/components/core/Layout/Layout.tsx +++ b/components/core/Layout/Layout.tsx @@ -36,14 +36,14 @@ const Layout: FC = ({ children, pageProps }) => { isDisabled: !(displaySidebar || displayModal), }) - const handleScroll = useCallback(() => { + const handleScroll = useCallback( debounce(() => { const offset = 0 const { scrollTop } = document.documentElement if (scrollTop > offset) setHasScrolled(true) else setHasScrolled(false) }, 1) - }, []) + , []) useEffect(() => { document.addEventListener('scroll', handleScroll)