auto-claude: subtask-4-4 - Add JSDoc to useScrollLock.ts hook

This commit is contained in:
2026-01-25 12:02:08 +01:00
parent a4f7db006e
commit 7d17d8e262
+10
View File
@@ -1,8 +1,18 @@
/**
* Scroll Lock Hook
* Manages body scroll locking based on state and navigation transitions
*/
// hooks/useScrollLock.ts
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import { useScrollContext } from '../components/ScrollContext';
/**
* Custom hook to lock/unlock page scrolling
* Automatically handles scroll restoration on route changes and cleanup on unmount
* @param lock - Whether to lock the page scroll
*/
export const useScrollLock = (lock: boolean) => {
const location = useLocation();
const { isTransitioning, lockScroll, unlockScroll } = useScrollContext();