React-Router open Link in new tab
Since React Router version 5.0.1, you can use:
<Link to="route" target="_blank" rel="noopener noreferrer" />
I think Link component does not have the props for it.
You can have alternative way by create a tag and use the makeHref method of Navigation mixin to create your url
<a target='_blank' href={this.makeHref(routeConsts.CHECK_DOMAIN, {},
{ realm: userStore.getState().realms[0].name })}>
Share this link to your webmaster
</a>
We can use the following options:-
// first option is:-
<Link to="myRoute" params={myParams} target="_blank">
// second option is:-
var href = this.props.history.createHref('myRoute', myParams);
<a href={href} target="_blank">
//third option is:-
var href = '/myRoute/' + myParams.foo + '/' + myParams.bar;
<a href={href} target="_blank">
We can use either of three option to open in new tab by react routing.