reactjs open link in new tab Example Tutorial

Today, We want to share with you reactjs open link in new tab.In this post we will show you react open link on button click, hear for How to Open URL in New Tab using ReactJS we will give you demo and example for implement.In this post, we will learn about react open link in new tab programmatically with an example.

reactjs open link in new tab

There are the Following The simple About react external link in new tab Full Information With Example and source code.

As I will cover this Post with live Working example to develop react open new tab programmatically, so the react-router history push new tab is used for this example is following below.

Read Also:  Laravel Passing Multiple Variables from Controller to View

HTML link in a new window

Open a link in a new window or tab

<a href="../pakainfo.htm" target="_blank" rel="noopener noreferrer">Open page in new window</a>

New window or new tab

Open a link in a new window with specified size

<a href="../pakainfo.htm" target="popup" onclick="window.open('../pakainfo.htm','name','width=600,height=400')" rel="noopener noreferrer">Open page in new window</a>

How to Open URL in New Tab using react ?

index.html

<html> 
  
<body> 
  
    <p>Click the button to open a new tab react</p> 
  
    <button onclick="NewTab()"> 
      Open pakainfo 
  </button> 
  
    <script> 
        function NewTab() { 
            window.open( 
              "https://www.pakainfo.com", "_blank"); 
        } 
    </script> 
  
</body> 
  
</html> 

Web Programming Tutorials Example with Demo

Read :

Read Also:  react open link in new tab

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about react open new tab on button click.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.