useScript
Loads a third party script and returns a value when it's loaded or fails to load.
There are a few hooks out there but they do not handle concurrency or rendering multiple components which require the same script at the same time.
Example
Testing
JSDom based tests can't load scripts, so you can use setTestLoadMode
to control when the script loads.
// Resolve any loaded scripts immediatelysetTestLoadModePromise.resolve
You will need to make sure you polyfill any globals that script would create if they are relied on by your tests