Home > database >  I want to open a new Tab in React application on button click?
I want to open a new Tab in React application on button click?

Time:04-22

I want to open a table tab in a new window to interact with the component separately. What's the best recommended method to do this functionality in React.js?

CodePudding user response:

  1. You can try target="_blank" for opening new tab if you are using <a href="SOME_URL" target="_blank"/>
  2. or you can use onClick event as shown onClick={()=> window.open("someLink", "_blank")} if you just need to put on button .

CodePudding user response:

try this pls . <a href="URL_LINK" target="_blank"/>.

such as :

<a href="http://localhost:3001/users" target="_blank"/> 
<a href="http://localhost:3001/personels" target="_blank"/> 
  • Related