useScrollLock

Whether the user processing page can scroll
Import
import { useScrollLock } from '@kubed/hooks;'
Source
View source code
Docs
Edit this page
npm
@kubed/hooks

Usage

useScrollLock Please click the button to see the effect

API

The useScrollLock hook accepts one parameter:

  • lock – whether to lock or not
1
function useScrollLock(
2
lock?: boolean
3
): readonly [boolean, React.Dispatch<React.SetStateAction<boolean>>]

Params

ParametersDefault ValueTypeDescription
lockfalsebooleanWhether the page locks scrolling

Result

ParametersDefault ValueTypeDescription
scrollLocked-booleanWhether it is locked
setScrollLocked-React.Dispatch<React.SetStateAction<boolean>>Set the current state