How to distinguish the a tag generated by react router Link from the normal a tag

Part of the

page is a tag generated by react router4 Link, and some are native a tags. I need to listen to all the an on the page. How can I tell the difference between the a tag generated by react router Link and the normal a tag?

$("body").on("click", "a", function (e)
{
    console.log(e)
    e.preventDefault()
})
Oct.26,2021

you can just change it to another tag

<Link to={'/abc'} type="span" />

it is indistinguishable without special treatment.
you can add some special parameters to Link .
for example:

<Link to={'....'}  name="fromLink" />

then distinguish according to this name.

Menu