function useScrollLock(locked: boolean): void;
You are most likely not going to need this hook and instead rely on existing components like the Dialog or Sheet to handle it for you.
The useScrollLock hook can be used to lock scrolling on the entire page.
function Example() {
const { toggled, toggle } = useToggle();
useScrollLock(toggled);
return <Button onClick={toggle}>Toggle</Button>;
}
locked - Boolean if the document.body should be no longer be scrollableNothing.