diff --git a/components/core/Layout/Layout.tsx b/components/core/Layout/Layout.tsx index c1ec2e896..90cb5b3a5 100644 --- a/components/core/Layout/Layout.tsx +++ b/components/core/Layout/Layout.tsx @@ -36,7 +36,7 @@ const Layout: FC = ({ children, pageProps }) => { isDisabled: !(displaySidebar || displayModal), }) - const handleScroll = useCallback(() => { + const handleScroll = useCallback( debounce(() => { const offset = 0 const { scrollTop } = document.documentElement @@ -44,7 +44,7 @@ const Layout: FC = ({ children, pageProps }) => { setHasScrolled(scrolled) }, 1) - }, []) + , []) useEffect(() => { document.addEventListener('scroll', handleScroll)