Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
react-swipe
Advanced tools
Brad Birdsall's Swipe.js as a React component.
Check out the demo from a mobile device (real or emulated).
npm install react swipe-js-iso react-swipe --save
import React from 'react';
import ReactDOM from 'react-dom';
import ReactSwipe from 'react-swipe';
const Carousel = () => {
let reactSwipeEl;
return (
<div>
<ReactSwipe
className="carousel"
swipeOptions={{ continuous: false }}
ref={el => (reactSwipeEl = el)}
>
<div>PANE 1</div>
<div>PANE 2</div>
<div>PANE 3</div>
</ReactSwipe>
<button onClick={() => reactSwipeEl.next()}>Next</button>
<button onClick={() => reactSwipeEl.prev()}>Previous</button>
</div>
);
};
ReactDOM.render(<Carousel />, document.getElementById('app'));
swipeOptions: ?Object
- supports all original options from Swipe.js config. If passed object differs from the previous one react-swipe
will re-initiate underlying Swipe.js instance with fresh options
style: ?Object
- object with 3 keys (see defaults):
container: ?Object
wrapper: ?Object
child: ?Object
regular props as className
, id
for root component are also supported
childCount: ?Number
- use it to explicitely tell react-swipe
that it needs to re-initiate underlying Swipe.js instance. For example, by setting the childCount
prop to the length
of the images array that you pass into react-swipe
, re-rendering will take place when the images.length
differs from the previous render
pass:
<ReactSwipe childCount={images.length}>{images}</ReactSwipe>
Component proxies all Swipe.js instance methods.
Configure the ReactSwipe component in a sandbox environment at CodeSandbox.
MIT Licensed
FAQs
Brad Birdsall's Swipe.js as a React component
The npm package react-swipe receives a total of 10,438 weekly downloads. As such, react-swipe popularity was classified as popular.
We found that react-swipe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.