I have a problem loading an external script inside a JSX reaction
<script> (function(d) { var config = { kitId: 1234567, scriptTimeout: 3000, async: true }, h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s) })(document); </script>
and here is my rendering function, where I would like to have javascipt load asyn, it is very simple in the html file, however, I am stunned inside the react component on how to make acheive. (If I can avoid installing another external module, it would be better). Thank you very much
render() { return ( <head> //Script to load asyn </head> ) }
source share