TypeScript is complaining
TS2322: Type '{ clientSecret: string; loader: string; }' is not assignable to type 'StripeElementsOptions'.
Types of property 'loader' are incompatible.
Type 'string' is not assignable to type '"always" | "auto" | "never"'.
Where the object is defined as
const options = {
clientSecret: paymentIntent.clientSecret,
loader: "always",
}
The error goes away if I define it like this instead:
const options = {
clientSecret: paymentIntent.clientSecret,
loader: "always" as "always",
}
But surely I shouldn't have to do that. Am I doing something wrong or is TS being overly aggressive here?