<Link to="invoices" target="_blank">Invoices</Link>
this opens a new tab. How do I do it for a new browser window ?
<Link to="invoices" target="_blank">Invoices</Link>
this opens a new tab. How do I do it for a new browser window ?
You can do window.open in a onClick, here's the documentation https://developer.mozilla.org/en-US/docs/Web/API/Window/open
As a hack (and I mean that genuinely), you can accomplish this in browsers which support the shift + click gesture to open a new window by using this for the onClick
function of the anchor element:
(event) => {
event.preventDefault();
event.target.dispatchEvent(new MouseEvent('click', {shiftKey: true}));
};
I tested it against Chrome desktop only.