react long press event

I’ve created a codesandbox with a hook to handle long press and click. Basically, on mouse down, touch start events, a timer is created with setTimeout. When the provided time elapses, it triggers long press. On mouse up, mouse leave, touchend, etc, the timer is cleared. useLongPress.js import { useCallback, useRef, useState } from “react”; … Read more