useLockBodyScroll
Lock the scroll of document body by setting the overflow property to hidden.
The useLockBodyScroll
hook is helpful when you want lock the scroll behaviour of the document body by setting the overflow property to hidden.
This is useful in components like <Dialog/>
or <Alerts/>
where you want to make the content beneath inert.
useLockBodyScroll
Body Scroll is : Unlocked
Usage
Import the hook from @abhushanaj/react-hooks
and use in required component.
API Reference
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
isLocked | boolean (optional) | Whether or not to lock the scroll on document body. | true |