Reputation: 534
I'm using connected react router, and i want to trigger an opening of a new window tab inside a function and not by a direct click on the Link component supplied by the router library.
I have read through the docs of reactrouter.com, but i have not been successful in finding a solution.
How can i trigger an opening of a new window tab inside a function, preferably using the react router library?
Upvotes: 0
Views: 262
Reputation: 11
Not sure how you would with reactrouter but you could simply use the snippet below. React router is really built around the idea of Single Page Applications.
window.open(`${url}`, "_blank");
Upvotes: 1