What was reported:
Issue paypal/paypal-js#572 (closed, 11 comments): ### react-paypal-js [paypal-js, react-paypal-js, direct script integration] ### 🐞 I am trying to integrate this. I am following the documentation. Sometimes my paypal button gets loaded but sometimes it doesn't in the component. How can I fix this? `Uncaught runtime errors: × ERROR Unable to render [PayPalButtons] because window.paypal.Buttons is undefined. To fix the issue, add 'buttons' to the list of components passed to the parent PayPalScriptProvider: `the PayPalScriptProvider element (options={{ components: 'buttons'}})`. Error: Unable to render [PayPalButtons] because window.paypal.

What works:
If PayPalButtons fails with 'window.paypal.Buttons is undefined', do what the error says: pass components: 'buttons' in the parent PayPalScriptProvider options, and make sure PayPalButtons is rendered inside that provider. If it still fails intermittently, one user fixed it by adding dataNamespace: 'paypal_sdk' to the script options to avoid namespace conflicts, and another found an element with id 'paypal' was shadowing window.paypal, so check for ID collisions too.