React-Router open link in new tab


Mike:

Is there a way to make React Router open links in new tabs? I tried it and it didn't work.

<Link to="chart" target="_blank" query={{test: this.props.test}} >Test</Link>

It can be blurred by adding something similar to what I have above to the onClick="foo"Link , but I get a console error.

thanks.

user1369825:

I don't think the Link component has its support.

You can create an alternative to the url by creating the markup and using the makeHref method of the Navigation mixin

<a target='_blank' href={this.makeHref(routeConsts.CHECK_DOMAIN, {},
   { realm: userStore.getState().realms[0].name })}>
        Share this link to your webmaster
</a>

Related


React-Router open link in new tab

Mike: Is there a way to make React Router open links in new tabs? I tried it and it didn't work. <Link to="chart" target="_blank" query={{test: this.props.test}} >Test</Link> It can be blurred by adding something similar to what I have above to the onClick="f

React-Router open link in new tab

Mike Is there a way to make React Router open links in new tabs? I tried it and it didn't work. <Link to="chart" target="_blank" query={{test: this.props.test}} >Test</Link> It can be blurred by adding something similar to what I have above to the onClick="fo

React-Router open link in new tab

Mike: Is there a way to make React Router open links in new tabs? I tried it and it didn't work. <Link to="chart" target="_blank" query={{test: this.props.test}} >Test</Link> It can be blurred by adding something similar to what I have above to the onClick="f

React-Router open link in new tab

Mike Is there a way to make React Router open links in new tabs? I tried it and it didn't work. <Link to="chart" target="_blank" query={{test: this.props.test}} >Test</Link> It can be blurred by adding something similar to what I have above to the onClick="fo

React Router - open link on new tab and redirect to homepage

Jonka 33 Using React Router 4.2 My attempt is to open a new tab when the nav link is clicked while redirecting it to the website home page. ie: Navigation Bar: Click Policy Even though the code below has the above requirements: is this a viable workaround? Aim

React Router - open link on new tab and redirect to homepage

Jonka 33 Using React Router 4.2 My attempt is to open a new tab when the nav link is clicked while redirecting it to the website home page. ie: Navigation Bar: Click Policy Even though the code below has the above requirements: is this a viable workaround? Aim

React Router - open link on new tab and redirect to homepage

Jonka 33 Using React Router 4.2 My attempt is to open a new tab when the nav link is clicked while redirecting it to the website home page. ie: Navigation Bar: Click Policy Even though the code below has the above requirements: is this a viable workaround? Aim

React Router - open link on new tab and redirect to homepage

Jonka 33 Using React Router 4.2 My attempt is to open a new tab when the nav link is clicked while redirecting it to the website home page. ie: Navigation Bar: Click Policy Even though the code below has the above requirements: is this a viable workaround? Aim

Open link in new tab

no mice here I need to open a link <a>in a new tab/window 's tab, do something there and then close it. html code: <body> <a id="uniqueid" href="somelink">I need to open this in a new tab</a> </body> python code: from selenium import webdriver driver = w

React Router browserHistory.push opens link in new tab

Kousha can be <link>used as <Link to="route" target="_blank"> Open the link in a new tab. But can it be used to browserHistory.pushopen a link in a new tab? Ursus React-router is built on the browser's History API. browserHistory.pushcall method.pushState() F

Can't open new tab in react, add localhost:3000 on link?

gpbaculio I've used this link from React Router Doms: <Link target="_blank" to={"www.mylink.com"} >mylink </Link> But this will also use href: open new tab to http://localhost:3000/www.mylink.com . <a href={'www.mylink.com'} target="_blank" > mylink </a> Sam

Can't open new tab in react, add localhost:3000 on link?

gpbaculio I've used this link from React Router Doms: <Link target="_blank" to={"www.mylink.com"} >mylink </Link> But this will also use href: open new tab to http://localhost:3000/www.mylink.com . <a href={'www.mylink.com'} target="_blank" > mylink </a> Sam

Can't open new tab in react, add localhost:3000 on link?

gpbaculio I've used this link from React Router Doms: <Link target="_blank" to={"www.mylink.com"} >mylink </Link> But this will also use href: open new tab to http://localhost:3000/www.mylink.com . <a href={'www.mylink.com'} target="_blank" > mylink </a> Sam

Can't open new tab in react, add localhost:3000 on link?

gpbaculio I've used this link from React Router Doms: <Link target="_blank" to={"www.mylink.com"} >mylink </Link> But this will also use href: open new tab to http://localhost:3000/www.mylink.com . <a href={'www.mylink.com'} target="_blank" > mylink </a> Sam

Can't open new tab in react, add localhost:3000 on link?

gpbaculio I've used this link from React Router Doms: <Link target="_blank" to={"www.mylink.com"} >mylink </Link> But this will also use href: open new tab to http://localhost:3000/www.mylink.com . <a href={'www.mylink.com'} target="_blank" > mylink </a> Sam

Can't open new tab in react, add localhost:3000 on link?

gpbaculio I've used this link from React Router Doms: <Link target="_blank" to={"www.mylink.com"} >mylink </Link> But this will also use href: open new tab to http://localhost:3000/www.mylink.com . <a href={'www.mylink.com'} target="_blank" > mylink </a> Sam

Open link in new tab or window

Rene Is it possible to open a link a hrefin a new tab instead of the same tab ? <a href="http://your_url_here.html">Link</a> Nason You should add target="_blank"and in the anchor tag rel="noopener noreferrer". E.g: <a target="_blank" rel="noopener noreferrer"

pandoc: open link in new tab

singles According to this answer , it should be possible to use the following syntax [link](url){:target="_blank"} When used, links can be opened in a new tab pandoc. However, this option does not seem to be supported as it is not recognized when converting t

Button to open link in new tab

Alex Hawking I'm building a website and I want to open a new tab at a specific address when a button is clicked. Here is the html of my button: <button id="AsDownload" onclick="AsDownload();">Download</button> Here is my javascript: function AsDownload(){

Open link in new tab or window

Rene Is it possible to open a link a hrefin a new tab instead of the same tab ? <a href="http://your_url_here.html">Link</a> Nason You should add target="_blank"and in the anchor tag rel="noopener noreferrer". E.g: <a target="_blank" rel="noopener noreferrer"

pandoc: open link in new tab

singles According to this answer , it should be possible to use the following syntax [link](url){:target="_blank"} When used, links can be opened in a new tab pandoc. However, this option does not seem to be supported as it is not recognized when converting t

Button to open link in new tab

Alex Hawking I'm building a website and I want to open a new tab at a specific address when a button is clicked. Here is the html of my button: <button id="AsDownload" onclick="AsDownload();">Download</button> Here is my javascript: function AsDownload(){

phpBB open link in new tab

Adam I have a phpBB board 3 with prosilver style. When the user clicks the link in the post, the browser will open it in the same tab. Can I change it so that the browser opens the link in a new tab or window? Alexandra Dunn To complete Steve's answer, if you

Open link in new tab or window

Rene Is it possible to open a link a hrefin a new tab instead of the same tab ? <a href="http://your_url_here.html">Link</a> Nason You should add target="_blank"and in the anchor tag rel="noopener noreferrer". E.g: <a target="_blank" rel="noopener noreferrer"

pandoc: open link in new tab

singles According to this answer , it should be possible to use the following syntax [link](url){:target="_blank"} When used, links can be opened in a new tab pandoc. However, this option does not seem to be supported as it is not recognized when converting t

Button to open link in new tab

Alex Hawking I'm building a website and I want to open a new tab at a specific address when a button is clicked. Here is the html of my button: <button id="AsDownload" onclick="AsDownload();">Download</button> Here is my javascript: function AsDownload(){

phpBB open link in new tab

Adam I have a phpBB board 3 with prosilver style. When the user clicks the link in the post, the browser will open it in the same tab. Can I change it so that the browser opens the link in a new tab or window? Alexandre Tranchant To complete Steve's answer, if

Rails: Open link in new tab (with "link_to")

Dantes I have this code: <%= link_to image_tag("facebook.png", :class => "facebook_icon", :alt => "Facebook", :target => "_blank"), "http://www.facebook.com/mypage" %> When the user clicks the link, how can I open it in a new tab?