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 :: js get words first letter 
Javascript :: jquery show hide based on data attribute 
Javascript :: custom timestamp name mongoose 
Javascript :: linux cli format json 
Javascript :: how to use saved image on react 
Javascript :: open folder node js 
Javascript :: remove table line button html using javascript 
Javascript :: higher order function in javascript 
Javascript :: socket.io cors 
Javascript :: hammer js cdn 
Javascript :: react dynamic load script 
Javascript :: react native custom debounce input 
Javascript :: get random element from string array java 
Javascript :: wait until something happens javascript 
Javascript :: val jquery 
Javascript :: remove element from array javascript by index 
Javascript :: add two numbers in javascript 
Javascript :: input two decimal places javascript 
Javascript :: js caps first letter 
Javascript :: yaml to json javascript 
Javascript :: how to clear an input in testing library 
Javascript :: Node -Cron Run every minute 
Javascript :: download file from any url 
Javascript :: react router dom change default path 
Javascript :: js join array 
Javascript :: what is json 
Javascript :: apollo server change port 
Javascript :: how to get array from object in javascript 
Javascript :: how to check string uppercase or lowersace using regex javascript 
Javascript :: round to decimal javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =