Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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)
}
 
PREVIOUS NEXT
Tagged: #react #dynamic #load #script
ADD COMMENT
Topic
Name
6+6 =