Answers for "react dynamic load script"

0

react dynamic load script

function loadScript(src: string): void {
  const tag = document.createElement('script')
  tag.async = false
  tag.src = src
  tag.type = "module" // if it's a module
  document.body.appendChild(tag)
}
Posted by: Guest on June-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language