Double tap hook
  • Introduction
  • Installation
  • Basics
  • Advanced
    • Definition
    • Callback
    • Threshold
    • Options
      • Callbacks
        • Single tap
    • Hook result / Bind object
      • Handlers
  • Examples
    • Live demo
      • Version 1
  • Migration
    • Change log
Powered by GitBook
On this page

Was this helpful?

Basics

Basic hook usage

import React from 'react';
import { useDoubleTap } from 'use-double-tap';

export const Example = () => {
    const bind = useDoubleTap((event) => {
      // Your action here
      console.log('Double tapped');
    });

    return <button {...bind}>Tap me</button>;
}
PreviousInstallationNextDefinition

Last updated 1 year ago

Was this helpful?