title: How do I execute function after loading all external library with React Hook useEffect?
body: <p>I want to execute main() after making sure loading all libraries.</p>
  
  <pre><code>useEffect(() =&gt; { 
      for (const id in urls) {
        let tag = document.createElement('script');
        tag.async = false;
        tag.src = urls[id];
        let body = document.getElementsByTagName('body')[0];
        body.appendChild(tag);
      }
      main()
  },[]); 
  </code></pre>