How to import a javascript package from a CDN/script tag in React?

Spread the love

To import a javascript package from a CDN/script tag in React, we get the variable from window.

For instance, we write

<script src="https://cdn.dwolla.com/1/dwolla.js"></script>

to add the script tag for dwolla.

Then we write

const dwolla = window.dwolla;

to get dwolla from window.dwolla.

Leave a Reply

Your email address will not be published. Required fields are marked *