react-use-scroll-lock
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

react-use-scroll-lock Build Status

React custom hook to conditionally enable body scroll lock.

Installation

npm install --save react-use-scroll-lock

Usage

import React, { useState } from 'react';
import useScrollLock from 'react-use-scroll-lock';
 
const MyComponent = () => {
    const [shouldLockBody, setShouldLockBody] = useState(false);
    useScrollLock(shouldLockBody);
    
    return <div> Hi World </div>;
}
 
export default MyComponent;

Package Sidebar

Install

npm i react-use-scroll-lock

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

5.92 kB

Total Files

9

Last publish

Collaborators

  • moldy530