stripe / connect-js

Loading wrapper for Connect.js
https://stripe.com/docs/connect/get-started-connect-embedded-components
MIT License
20 stars 8 forks source link

payment-details embedded component pops empty, disappear, and re-pops before displaying info about payment #148

Open dvadri opened 4 weeks ago

dvadri commented 4 weeks ago

When using the payment-details embedded component (alone, without the payments embedded component)... no matter if called from a button "View payment details" or if executed on page load... it always pops empty, disappear, and re-pops before displaying info about payment. How to fix it?

dvadri commented 4 weeks ago

Stripe talks about this popping behaviour here, but couldn't find a way to actually fix it. https://docs.stripe.com/connect/get-started-connect-embedded-components#reacting-to-component-display PS.: I am using the pure version import { loadConnectAndInitialize } from '@stripe/connect-js/pure';

jojo-stripe commented 4 weeks ago

Could you attach a video of this behavior?

dvadri commented 4 weeks ago

https://github.com/user-attachments/assets/1d37bed4-a802-4149-b809-163772ec3028

kaiying-stripe commented 4 weeks ago

This isn't an known issue and seems like a bug, could you provide a small github repo that reproduces this issue? Thanks!

MaherBouidani commented 3 weeks ago

It could be related to the state updated asynchronously (e.g., after an API call). In that case, the component might render before the state is populated, causing it to briefly appear empty and re-render when it is updated.