I am trying to use a variable from a library I have loaded in a script tag in my index.html for my React components. I've loaded it as normal:
<head>
...
<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
<!-- gives me the 'Plaid' library -->
...
<title>React App</title>
</head>
However, when I try accessing Plaid in my React components, it's undefined. I am confused because if I put in a debugger right before it, I can still access it. For instance, in my App.js component, I have:
componentDidMount() {
debugger // can access 'Plaid' here
Plaid // throws error, 'Plaid' is undefined
}
Why is it that Plaid throws an error, even though I can access it through the debugger?
npm start, which I think goes through Webpack before compiling? It's installed as a node module by default.