New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-touch-component

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-touch-component

react-touch-component

latest
Source
npmnpm
Version
1.1.4
Version published
Maintainers
2
Created
Source

react-touch-component

NPM Version

借鉴zepto touch封装的React Component

onTap事件兼容PC使用

Base on zepto touch lib.

onTap event also works with PC as well.

Supported Events

  • onTap
  • onSingleTap
  • onDoubleTap
  • onLongTap
  • onSwipe
  • onSwipeUp
  • onSwipeRight
  • onSwipeDown
  • onSwipeLeft

Installation

$ npm install react-touch-component --save

Usage

React 版本

import Touch from 'react-touch-component';

export default class Demo extends Component {
  constructor(props, context) {
    super(props, context);
    this.state = {};
    this.handleTap = this.handleTap.bind(this);
  }
  
  handleTap() {
    console.log('tap!');
  }
  
  render() {
    <Touch onTap={this.handleTap}>
      <button>Tap me</button>
    </Touch>
  }
}

Preact版本

import Touch from 'react-touch-component/lib/pindex';

Changelog

  • v1.1.4 (2017/12/27) 完善Node环境兼容
  • v1.1.3 (2017/11/11) 完善Node环境兼容
  • v1.1.1 (2017/6/12) 兼容React v15.5后的版本
  • v1.1.0 (2017/2/28) 新增preact版本
  • v1.0.1 (2017/2/22) 兼容Node环境,防止脚本报错
  • v1.0.0 (2017/2/8) 初版

Keywords

react

FAQs

Package last updated on 27 Dec 2017

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