diff options
Diffstat (limited to 'src/utils/hooks/use-scroll-position.tsx')
| -rw-r--r-- | src/utils/hooks/use-scroll-position.tsx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/utils/hooks/use-scroll-position.tsx b/src/utils/hooks/use-scroll-position.tsx index 47cfdd0..c6ae9fd 100644 --- a/src/utils/hooks/use-scroll-position.tsx +++ b/src/utils/hooks/use-scroll-position.tsx @@ -5,11 +5,9 @@ import { useEffect } from 'react'; * * @param scrollHandler - A callback function. */ -const useScrollPosition = (scrollHandler: () => void) => { +export const useScrollPosition = (scrollHandler: () => void) => { useEffect(() => { window.addEventListener('scroll', scrollHandler); return () => window.removeEventListener('scroll', scrollHandler); }, [scrollHandler]); }; - -export default useScrollPosition; |
