Skip to main content
.onTapGesture(action: (locationInView: Point) => void): Component;
.onTapGesture(props: { count: number }, action: (locationInView: Point) => void): Component;

Parameters

action
(locationInView: Point) => void
The action to perform when the gesture is recognized.
props
{ count: number }
Gesture configuration.

Support

Usage

Single tap

Button("Tap me", () => {})
    .onTapGesture((location) => {
        console.log("Tapped at", location)
    })

Double tap

Image("photo.jpg")
    .onTapGesture({ count: 2 }, (location) => {
        console.log("Double tapped")
    })

Triple tap

Text("Triple tap me")
    .onTapGesture({ count: 3 }, () => {
        console.log("Triple tapped!")
    })