//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')}
<td onClick={()=> window.open("someLink", "_blank")}>text</td>
import React from "react";
function App() {
const handleClick = () => {
window.open("http://twitter.com/saigowthamr");
};
return (
<div>
<h2>App</h2>
<button onClick={handleClick}>Twitter</button>
</div>
);
}
export default App;
<td onClick={()=> window.open("someLink", "_blank")}>text</td>