Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@atakanermis/react-scroll-wheel-handler
Advanced tools
Simple react component for handling scroll trackpad, arrow keys, swipe gestures and mouse wheel event.
Simple react component for handling scroll trackpad, arrow keys, swipe gestures and mouse wheel event.
#Update
add prop disableSwipe.
removed customStyle from props.
Replace CustomContainerComponent with CustomComponent. It must have ref passed as a prop. Example:
const CustomComponent = forwardRef(({ children, ...props }, ref) => (
<div ref={ref} {...props} id="custom">
{children}
</div>
));
npm install --save react-scroll-wheel-handler
or
yarn add react-scroll-wheel-handler
import ReactScrollWheelHandler from "react-scroll-wheel-handler";
<ReactScrollWheelHandler
upHandler={(e) => console.log("scroll up")}
downHandler={(e) => console.log("scroll down")}
>
...
</ReactScrollWheelHandler>
#Props
All the other props are passed to the div/component returned.
import React, { Component } from "react";
import ReactScrollWheelHandler from " react-scroll-wheel-handler";
class App extends React.Component {
state = {
currentIndex: 0,
colors: ["red", "black", "grey", "blue", "green"],
};
nextIndex = () => {
const { colors, currentIndex } = this.state;
if (currentIndex == colors.length - 1) {
return this.setState({ currentIndex: 0 });
}
return this.setState({
currentIndex: currentIndex + 1,
});
};
prevIndex = () => {
const { colors, currentIndex } = this.state;
if (currentIndex == 0) {
return this.setState({
currentIndex: colors.length - 1,
});
}
return this.setState({
currentIndex: currentIndex - 1,
});
};
render() {
const { colors, currentIndex } = this.state;
return (
<div>
<ReactScrollWheelHandler
upHandler={this.prevIndex}
downHandler={this.nextIndex}
style={{
width: "100%",
height: "100vh",
backgroundColor: colors[currentIndex],
transition: "background-color .4s ease-out",
}}
>
<h1>SCROLL FOR CHANGE BACKGROUND COLOR</h1>
</ReactScrollWheelHandler>
</div>
);
}
}
FAQs
Simple react component for handling scroll trackpad, arrow keys, swipe gestures and mouse wheel event.
The npm package @atakanermis/react-scroll-wheel-handler receives a total of 22 weekly downloads. As such, @atakanermis/react-scroll-wheel-handler popularity was classified as not popular.
We found that @atakanermis/react-scroll-wheel-handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.