Skip to content

Instantly share code, notes, and snippets.

@mikaelhadler
Created May 8, 2020 18:53
Show Gist options
  • Save mikaelhadler/79122bf9618387ae7a211640270a9167 to your computer and use it in GitHub Desktop.
Save mikaelhadler/79122bf9618387ae7a211640270a9167 to your computer and use it in GitHub Desktop.
const handleOpenPdf = url => {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment