useTap
Provides a ref and a reactive boolean state indicating whether the attached element is currently being pressed down by a pointer.
Importing
1
import { useTap } from '@infinityfx/lively/hooks';Usage
Call signature
1
const [ref, tapping] = useTap<T extends HTMLElement>()
Returns
ref:
React.RefObject<T | null> A React ref to attach to the target DOM element.
tapping:
boolean A boolean value indicating if the element is currently pressed down.