react-elegant-ui
Version:
Elegant UI components, made by BEM best practices for react
18 lines (17 loc) • 476 B
TypeScript
import { RefObject } from 'react';
export interface UsePreventScrollOptions {
enabled: boolean | undefined;
containerRef?: RefObject<HTMLElement>;
}
/**
* @example
* const Modal: FC<ModalProps> = (props) => {
* const { visible } = props;
* const containerRef = useRef(document.documentElement);
*
* usePreventScroll({ enabled: visible, containerRef });
*
* ...
* }
*/
export declare function usePreventScroll(options: UsePreventScrollOptions): void;