@seamusleahy/pointer-down-then-up
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha • Public • Published

@seamusleahy/pointer-down-then-up: onClick for pointer events

A replacement for onClick when you want to use pointer events.

Installation

This module is available via NPM.

# if you're using npm
npm install @seamusleahy/pointer-down-then-up
# if you're using yarn
yarn add @seamusleahy/pointer-down-then-up

This module does not bundle React but requires your project to include React 16.8 or higher.

# if you're using npm
npm install react
# if you're using yarn
yarn add react

This module provides TypeScript type definitions to work with your TypeScript project.

How-to use

Wrap the component to add the pointerUpThenDown event to with with <PointerUpThenDown>.

import { PointerDownThenUp } from "@seamusleahy/pointer-down-then-up";

export const Button: FC<{action: () => void}> = ({ action }) => {
  return (
    <PointerDownThenUp onPointerDownThenUp={action}>
      <button>Click me</button>
    </PointerDownThenUp>
  );
};

Readme

Keywords

Package Sidebar

Install

npm i @seamusleahy/pointer-down-then-up

Weekly Downloads

0

Version

1.0.0-alpha

License

Apache-2.0

Unpacked Size

18.1 kB

Total Files

10

Last publish

Collaborators

  • seamusleahy