title: ReactJS - Adding (Mollie) script to React page
body: <p>I'm trying to import a script called Mollie (used for payments), but I'm not sure how to do it in React.
  Normally in Javascript you would do something like this:</p>
  <pre><code> &lt;html&gt;
     &lt;head&gt;
       &lt;title&gt;My Checkout&lt;/title&gt;
     &lt;/head&gt;
     &lt;body&gt;
       &lt;script src=&quot;https://js.mollie.com/v1/mollie.js&quot;&gt;&lt;/script&gt;
     &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  <p>I've tried this (according to other Stackoverflow posts)</p>
  <pre><code>useEffect(() =&gt; {
      const script = document.createElement(&quot;script&quot;);
      script.src = &quot;https://js.mollie.com/v1/mollie.js&quot;;
      script.addEventListener(&quot;load&quot;, () =&gt; setScriptLoaded(true));
      document.body.appendChild(script);
  }, []); 
  const mollie = Mollie(); // Mollie is not defined
  </code></pre>
  <p>But then <code>Mollie</code> is undefined. Can anyone point in the right direction on how to <code>import Mollie</code> in React?</p>
  <p>I'm following <a href="https://docs.mollie.com/components/overview" rel="nofollow noreferrer">this guide</a> (but it's for standard Javascript)</p>