Coder Social home page Coder Social logo

aweffr / react-native-double-click Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rubythonode/react-native-double-click

0.0 1.0 0.0 137 KB

A Component Wrapper for Double Click/Tap

Home Page: https://www.npmjs.com/package/react-native-double-click

JavaScript 100.00%

react-native-double-click's Introduction

react-native-double-click

A Component Wrapper for Double Click/Tap, made for React Native, works on both Android and iOS.

Installation

  • npm install --save react-native-double-click

Usage

import React, { Component } from 'react';
import {
  Text,
  View,
  Alert,
} from 'react-native';
import DoubleClick from 'react-native-double-click';

export default class doubleClicker extends Component {
  constructor() {
    super();

    this.handleClick = this.handleClick.bind(this);
  }

  handleClick() {
    Alert.alert('This is awesome \n Double tap succeed');
  }

  render() {
    return (
      <View style={{ flex: 1, marginTop: 50 }}>
        <Text style={{ fontSize: 20 }}>
          Welcome to React Native!
        </Text>
        <DoubleClick onClick={this.handleClick}>
          <Text style={{ fontSize: 26 }}>
            Please tap me twice!
          </Text>
        </DoubleClick>
      </View>
    );
  }
}

Props

Property Type Default Description
delay number 300 (in milliseconds) How fast double click/tap be pressed (number below 200 might not worked)
radius number 20 Radius for click/tap
onClick function () => Alert.alert('Double Tap Succeed') Execute function after double click/tap be pressed

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.