title: Append multiple script tags to head that execute synchronously in React
body: <p>I'm trying to add multiple script tags to the head of a page in React using <code>react-helmet</code>. I want these scripts to execute in the order they're included, as one would normally expect in regular HTML. But it seems there is a <a href="https://github.com/nfl/react-helmet/issues/419" rel="nofollow noreferrer">known bug</a> in <code>react-helmet</code> which makes the scripts load asynchronously and they get executed in a random order which messes up the intended use since some scripts are dependent on other ones.</p>
  <p>Is there a way to append multiple script tags to the <code>&lt;head&gt;</code> of a page in react so they execute in order?</p>
  <p>Here's my code:</p>
  <pre><code>    &lt;Helmet&gt;
        {isPermissionAllowed &amp;&amp; (
          &lt;script type=&quot;text/javascript&quot; src={getFirstEndpoint()}&gt;&lt;/script&gt;
        )}
        {isPermissionAllowed &amp;&amp; (
          &lt;script type=&quot;text/javascript&quot;&gt;{`window.sample = &quot;${getSample()}&quot;;`}&lt;/script&gt;
        )}
        {isPermissionAllowed &amp;&amp; (
          &lt;script type=&quot;text/javascript&quot; src={getSecondEndpoint()}&gt;&lt;/script&gt;
        )}
        {isPermissionAllowed &amp;&amp; (
          &lt;script type=&quot;text/javascript&quot;&gt;window.example.text[&quot;app.sample&quot;] = &quot;sample&quot;;&lt;/script&gt;
        )}
      &lt;/Helmet&gt;
  </code></pre>