Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to open a new tab in react

//More Secure Solution. For JS only.

const openInNewTab = (url) => {
  const newWindow = window.open(url, '_blank', 'noopener,noreferrer')
  if (newWindow) newWindow.opener = null
}

//Then add to your onClick
onClick={() => openInNewTab('https://stackoverflow.com')}
Comment

open a new tab when clicking on a link react

<td onClick={()=> window.open("someLink", "_blank")}>text</td>
Comment

open in a new tab react

<td onClick={()=> window.open("someLink", "_blank")}>text</td>
Comment

how i do button when click open a new tab in react

<a  className="btn btn-primary  btn-outline btn-lg"  href="https://google.com/" rel="noopener noreferrer" target="_blank">google</a>
Comment

PREVIOUS NEXT
Code Example
Javascript :: console group 
Javascript :: javascript var dump 
Javascript :: javascript get years since a date 
Javascript :: js pi 
Javascript :: javascript binary to int 
Javascript :: sequelize like search 
Javascript :: set padding jquery 
Javascript :: uppercase angular pipe 
Javascript :: loop 
Javascript :: how to find parent table of tr in jquery 
Javascript :: material-ui hover style 
Javascript :: jquery append text to div 
Javascript :: remove all dots from string javascript 
Javascript :: numeros primos js 
Javascript :: bubble sort javascript 
Javascript :: javascript change web page title 
Javascript :: string to number angularjs 
Javascript :: difference between e.preventdefault and e.stoppropagation and return false 
Javascript :: get discord.js role 
Javascript :: remove non prime numbers js 
Javascript :: if string javascript 
Javascript :: Code to Unsubscribe all youtube channels. 
Javascript :: free json hosting 
Javascript :: apply back button to a react component 
Javascript :: addeventlistener to button javascript 
Javascript :: upload file using ajax 
Javascript :: ngmodeloptions standalone 
Javascript :: nodejs delete folder recursively 
Javascript :: search partial string in array javascript 
Javascript :: append option to select ajax javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =