Function useMouseDownAndHoldListener

  • Simple hook that calls onMouseDown at intervals until mouse is up.

    Parameters

    • onPointerDown: ((event) => boolean | void)
        • (event): boolean | void
        • Parameters

          • event: PointerEvent<Element>

          Returns boolean | void

    • Optional options: RepeatClickOptions

    Returns ((event) => void)

      • (event): void
      • Parameters

        • event: React.PointerEvent<Element>

        Returns void

    Remarks

    This will fire the original mouse down event so preventDefault should be ignored or treated accordingly.