Open mariana-berkii opened 6 months ago
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
We have moved this repository to our paypal-js monorepo: https://github.com/paypal/paypal-js
We will be archiving this repo at the end of the day which will turn off Issues activity. If this is still an issue for you, please re-open this issue here:
Transferring this issue here: https://github.com/paypal/paypal-js/issues
Any update on this bug? We're showing a component to render Paypal card form with condition. It works fine only once, the second times it always throws this error
react-paypal-js.js:1237 Uncaught Error: Failed to render <PayPalHostedFieldsProvider /> component. BraintreeError: Element already contains a Braintree iframe.
bump
Is there an existing issue for this?
🐞 Describe the Bug
When the Hosted Fields component rerenders due to state changes, an error appears: Failed to render component. BraintreeError: Element already contains a Braintree iframe.
As I understand this happens because the PayPalHostedFieldsProvider component has been initiated and when rerender happens, the PayPalHostedFieldsProvider component doesn't check if the hosted fields instance exists, it just tries to render the card fields again, which throws an error.
😕 Current Behavior
On rerenderings Hosted Fields fail with the error:
🤔 Expected Behavior
When the checkout page rerenders due to state changes (e.g. changes to basket), it would be good if in such cases the PayPal Hosted Fields component would not try to render Hosted Fields once again, but use the existing instance.
🔬 Minimal Reproduction
No response
🌍 Environment
Relevant log output
No response
Code of Conduct
➕ Anything else?
No response