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

swipe-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swipe-react - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "swipe-react",
"version": "1.0.3",
"version": "1.0.4",
"description": "Easy integration!!! Easily add touch devices support (smartphones, tablets) to your react components, with swipe direction detection.",

@@ -5,0 +5,0 @@ "main": "main.js",

@@ -40,1 +40,55 @@ # swipe-react

```
# Example
```javascript
import React, { Component } from 'react';
import SwipeReact from 'swipe-react';
class App extends Component {
constructor(props){
super(props);
this.state = {
content: 'Swipe here!'
};
SwipeReact.config({
left: () => {
this.setState({
content: 'left direction detected.'
});
},
right: () => {
this.setState({
content: 'right direction detected.'
});
},
up: () => {
this.setState({
content: 'up direction detected.'
});
},
down: () => {
this.setState({
content: 'down direction detected.'
});
}
});
}
render() {
let styles = {
height: '400px',
fontSize: '34px',
textAlign: 'center'
};
return (
<div {...SwipeReact.events} tabIndex="1" style={styles}>
{this.state.content}
</div>
);
}
}
export default App;
```
### Remarks
* You need to test it on a touch screen device, or open Smartphone/Tablet mode on Chrome Developer Tools.
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