# useTapGesture

Hook that registers a tap gesture for the current Player

## Import

```tsx
import { useTapGesture } from "@videojs/react";
```

## Usage

Call the hook inside `Player`. It listens on the current player container unless `target` supplies another element.

```tsx
function TapFeedback() {
  useTapGesture(() => console.log("Tap"), { region: "center" });

  return null;
}
```

Use `pointer`, `region`, and `disabled` to control recognition. Supplying `target` does not make the hook safe outside `Player`, because it still reads the player container context.

## API Reference

`useTapGesture(onActivate, options?): void`

### Parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `onActivate` (required) | `((event: PointerEvent) => void)` | — | Callback invoked when a matching tap is recognized. |
| `options` | `{ pointer?: 'mouse' \| 'touch' \| 'pen'; region?: 'left' \| 'center' \| 'right'; disabled?: boolean; target?: RefObject<HTMLElement \| null> }` | — | Gesture matching, target, and disabled options. |

### Return Value

`void`

---

React documentation: https://videojs.org/docs/framework/react/llms.txt
All documentation: https://videojs.org/llms.txt
