How can I create a Double Click Link in react?

general discussion forum gives members an opportunity to discuss proposed policy ideas prior to submitting as a formal
Post Reply
admin
Site Admin
Posts: 36
Joined: Sun Aug 08, 2021 7:49 am

How can I create a Double Click Link in react?

Post by admin »

I have a Draggable image link that opens the link in a new tab. The problem is that when the image is dragged it of course ends up clicking the link, when I don't want it to. So how can I make it so that the link only activates on a double click?

<Draggable>
<div className="m-2">
<a
href={destination}
rel="noreferrer"
target="_blank"
className="relative cursor-zoom-in w-auto hover:shadow-lg rounded-lg overflow-hidden transition-all duration-500 ease-in-out"
>
<img
className="rounded-lg w-full"
alt="user-post"
src={urlFor(image).width(1000).url()}
/>
</a>
</div>
</Draggable>
Post Reply