Created
December 24, 2021 10:38
-
-
Save jagdishlove/83e0a9d8f468656c7c6ff3b86d4ea5e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const openInNewTab = (url) => { | |
const newWindow = window.open(url, '_blank', 'noopener,noreferrer') | |
if (newWindow) newWindow.opener = null | |
} | |
onClick={() => openInNewTab('https://stackoverflow.com')} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment