You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-wheeler

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-wheeler

React component for listening to and acting on scroll/wheel/touchmove events.

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

React-Wheeler by Adrian

Version Repository size Number of GitHub issues MIT License

React component for listening to and acting on scroll/wheel/touchmove events.

How to use

Installation

yarn add react-wheeler

As a component

import Wheeler from 'react-wheeler';

const YourComponent = () => {
  const handleWheelStart = () => {};
  const handleWheel = ({ delta }) => {};
  const handleWheelEnd = ({ delta }) => {};

  return (
    <>
      <Wheeler
        onWheel={handleWheel}
        onWheelStart={handleWheelStart}
        onWheelEnd={handleWheelEnd}
      />
    </>
  );
};

Properties

PropTypeDefaultDescription
throttleNumber20How many milliseconds between each onWheel event
onWheelStartfuncFired when wheeling starts
onWheelfuncFired while wheeling
onWheelEndfuncFired when wheeling has stopped
eventString'auto'Which event to listen to. Possible values 'auto', 'wheel', 'touch'
elementRefReact refElement reference created with React.createRef(). Required for touch

Development

yarn install to install dependencies

yarn start to start the file watcher to automatically build on file changes

Contribute

I'm open for pull requests if you've got any enhancements! You're a star! ⭐

Keywords

react

FAQs

Package last updated on 01 Jul 2019

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