react-native-multi-tap-component

0.1.1 • Public • Published

MultiTapComponent -- ReactNative的点击组件,支持判断点击次数

原始需求是,我在一副图片上想要同时处理单击和双击。但是,看了许多网上的例子,没有发现简单可靠的判断双击的方法。后来,在StackOverflow上受到一位高手的启发,通过debounce来实现了单击和双击的区分。现在把它分享给大家。

安装 Installation

  • npm install --save react-native-multi-tap-component

Usage

<MultiTapComponent onPress={(event,tapCount)=>this.onTapImage(event,tapCount)}>
    <View>
        {this.props.image}
    </View>
</MultiTapComponent>

/react-native-multi-tap-component/

    Package Sidebar

    Install

    npm i react-native-multi-tap-component

    Weekly Downloads

    20

    Version

    0.1.1

    License

    ISC

    Unpacked Size

    14 kB

    Total Files

    4

    Last publish

    Collaborators

    • kphungry