79321463

Date: 2025-01-01 10:37:22
Score: 1
Natty:
Report link

The @thomas-lo answer really helped me solve the issue. I just modify it a little so we could modify the url on the Link onClick event. Define this function:

const handleOpenNewTab = (href) => {
    window.open(href, '_blank');
};

and in the component:

<Link
     href="#"
     className="flex items-center"
     onClick={(e) => { e.preventDefault(); handleOpenNewTab('/my/url') }}
>
    print Pdf
</Link>
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @thomas-lo
  • Low reputation (0.5):
Posted by: David