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

Viewed 513

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?

2 Answers

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"/> 
  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 .
Related