Custom React hook that detects user interaction with a specified element.
This hook listens for both touchstart and mousedown events on the
provided reference element and triggers the specified effect when
these events occur. It is useful for detecting user interactions
in both touch and mouse environments.
Custom React hook that detects user interaction with a specified element.
This hook listens for both
touchstart
andmousedown
events on the provided reference element and triggers the specified effect when these events occur. It is useful for detecting user interactions in both touch and mouse environments.Example