function useScrollLock
useScrollLock(): void

Freezes the page's scroll while the calling component is mounted, so that the page doesn't slide under a dialog's backdrop. Nested locks are counted.

Return Type

void

Usage

import { useScrollLock } from "src/hooks/shared/useScrollLock.ts";