New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-scroll-context

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-scroll-context

A component to disable scroll on document body when its children are scrolled.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by10%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status License: MIT

react-scroll-context

A component to disable scroll on document body when its children are scrolled.

Install

yarn add react-scroll-context

or

npm install react-scroll-context --save

Props

  1. enable: boolean set this to true if you want to manually disable scroll. Eg:
    • enable: true Enables scroll context and prevents scroll on document body.
    • enable: false Disables scrolls context and allows scroll on document body.
  2. styles: string String of classNames to be added to the parent container.

WARNING The mouse events will not work if the enable prop is set to either(true / false).

Help

  1. Uses mouse listeners for desktop / laptop browsers.
  2. For mobile devices set enabled prop for enabling / disabling scroll context.
  3. Takes care of jumps due to scrollbars on windows, linux etc.

Example

import ScrollContext from 'react-scroll-context';

function Component(props) {
  return (
    <ScollContext>
        {// your awesome jsx}
    </ScrollContext>
  );
}

License

MIT

Keywords

FAQs

Package last updated on 26 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc