stripe / react-stripe-js

React components for Stripe.js and Stripe Elements
https://stripe.com/docs/stripe-js/react
MIT License
1.75k stars 267 forks source link

[BUG]: PaymentElement onLoaderStart sometimes fails to fire #482

Closed randypuro closed 5 months ago

randypuro commented 7 months ago

What happened?

Apologies, as it's difficult to create a reproduction since the failure is intermittent; however, we were able to reproduce the issue on our end with repetitive retries. We depend on PaymentElement onLoaderStart to show our UI, and occasionally this callback is not firing (although onReady still fires).

Environment

Chrome 122.0.6261.94 MacOS 14.3.1

Reproduction

No response

wahba-stripe commented 7 months ago

Hello!

If you don't pass in loader: always to your elements initialization, we might choose not to display it (e.g. form render optimization). We'll work on making the docs a bit more legible.

In the meanwhile if you depend on the loader, pass loader: always into the elements provider options.

Please let us know if this doesn't work for you.

randypuro commented 7 months ago

Ah, gotcha, that makes sense. Thanks for the clarification and apologies for the noise.