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

react onclick new tab

const openInNewTab = (url) => {
  const newWindow = window.open(url, '_blank', 'noopener,noreferrer')
  if (newWindow) newWindow.opener = null
}
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 :: from json timestamp to date python 
Javascript :: access to nested properties on javascript using property names 
Javascript :: get datepicker value date 
Javascript :: javascript foreach loop array 
Javascript :: create a customer in stripe node.js 
Javascript :: Example Of LinkedList In JavaScript 
Javascript :: useLocation for query params 
Javascript :: how to add array object in javascript 
Javascript :: javascript prevent value change in select option 
Javascript :: how to count duplicates in an array javascript 
Javascript :: filter function using recursion 
Javascript :: usestate callback 
Javascript :: javascript export default 
Javascript :: first node prog using express 
Javascript :: hincrby nodejs 
Javascript :: round down javascript 
Javascript :: can we fine a key with help of value in array of objects javascript 
Javascript :: defining functions in react 
Javascript :: how to change created_at format with javascript rails 
Javascript :: Algorithm used by strapi for password 
Javascript :: while loops js 
Javascript :: last index of array js 
Javascript :: js how to get element csswidth 
Javascript :: sails setup 
Javascript :: jq click with trigger load data 
Javascript :: javascript desktop app 
Javascript :: javascript create anchor link 
Javascript :: ajaxstart not working in chrome 
Javascript :: interpolation react 
Javascript :: webpack test js or jsx 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =