plaid / react-plaid-link

React bindings for Plaid Link
https://plaid.github.io/react-plaid-link
MIT License
268 stars 149 forks source link

Attempt to fix #285 #351

Closed clayallsopp closed 1 month ago

clayallsopp commented 1 month ago

This is tricky, see the comment. The core issue is that once a script is added to the page, there's not a generic way to check "is it loaded" (since the load event won't get fired if you add a listener too late) - each script could have its own way to check (which is what we do with window.Plaid below), but there doesn't seem to be a browser API to determine this.

Other solutions make different trade-offs (eg if it isn't loaded,

I also considered using patch-package (or copy-pasting) on the script hook to implement more logic to detect if the script was