1//More Secure Solution. For JS only.
2
3const openInNewTab = (url) => {
4 const newWindow = window.open(url, '_blank', 'noopener,noreferrer')
5 if (newWindow) newWindow.opener = null
6}
7
8//Then add to your onClick
9onClick={() => openInNewTab('https://stackoverflow.com')}