You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using confirmSetup in TypeScript, with, for example, options like these, TS will throw errors for missing properties like clientSecret, even though this is only required in a few of the overloads. It seems to have trouble selecting the proper one.
conststripeArguments={redirect: 'if_required',elements: (stripeElements.valueasStripeElements),confirmParams: {return_url: returnUrl,},}// Should not throw an error.stripe?.confirmSetup(stripeArguments)
Additionally, the type for redirect is set to "always", which is one of the options, but doesn't include "if_required".
it looks like it just uses the last overload at all times, which has this signature:
What happened?
When using
confirmSetup
in TypeScript, with, for example, options like these, TS will throw errors for missing properties likeclientSecret
, even though this is only required in a few of the overloads. It seems to have trouble selecting the proper one.Additionally, the type for
redirect
is set to"always"
, which is one of the options, but doesn't include"if_required"
.it looks like it just uses the last overload at all times, which has this signature:
The only workaround I have found is by creating a custom type to force the right overload to be selected:
Environment
Chrome 130 on MacOS 15.0.1
Reproduction
No response
The text was updated successfully, but these errors were encountered: