Broken typings for StripeAuBankAccountElement when using StripeElement
See original GitHub issueSummary
The (I assume new-ish) type StripeAuBankAccountElement
seems to break compatibility for resolving other elements such as StripeCardElement
against the parent StripeElement
.
https://github.com/stripe/stripe-js/blob/master/types/stripe-js/elements.d.ts#L14 (strangely imported here) https://github.com/stripe/stripe-js/blob/master/types/stripe-js/elements.d.ts#L251-L263
TS2322:
Type 'StripeElement' is not assignable to type 'StripeCardElement | StripeCardNumberElement | { token: string; }'.
Type 'StripeAuBankAccountElement' is not assignable to type 'StripeCardElement | StripeCardNumberElement | { token: string; }'.
Type 'StripeAuBankAccountElement' is not assignable to type 'StripeCardNumberElement'.
Type 'StripeAuBankAccountElement' is not assignable to type '{ on(eventType: "change", handler: (event: StripeCardNumberElementChangeEvent) => any): StripeCardNumberElement; on(eventType: "ready", handler: (event: { ...; }) => any): StripeCardNumberElement; on(eventType: "focus", handler: (event: { ...; }) => any): StripeCardNumberElement; on(eventType: "blur", handler: (even...'.
Types of property 'on' are incompatible.
Type '{ (eventType: "change", handler: (event: StripeAuBankAccountElementChangeEvent) => any): StripeAuBankAccountElement; (eventType: "ready", handler: (event: { ...; }) => any): StripeAuBankAccountElement; (eventType: "focus", handler: (event: { ...; }) => any): StripeAuBankAccountElement; (eventType: "blur", handler: (...' is not assignable to type '{ (eventType: "change", handler: (event: StripeCardNumberElementChangeEvent) => any): StripeCardNumberElement; (eventType: "ready", handler: (event: { ...; }) => any): StripeCardNumberElement; (eventType: "focus", handler: (event: { ...; }) => any): StripeCardNumberElement; (eventType: "blur", handler: (event: { ......'.
Types of parameters 'handler' and 'handler' are incompatible.
Types of parameters 'event' and 'event' are incompatible.
Property 'brand' is missing in type 'StripeAuBankAccountElementChangeEvent' but required in type 'StripeCardNumberElementChangeEvent'.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top Results From Across the Web
Scalelite session can't start by moodle: We could not find a meeting ...
Scalelite session can't start by moodle: We could not find a meeting with that meeting ID - scalelite. Hi I have Scalelite docker...
Read more >Filter resets column sorting - TanStack/React-Table - IssueHint
Broken typings for StripeAuBankAccountElement when using StripeElement, 16, 2021-09-17, 2022-11-06. Linux Kernel Panic for 80 INT Registers, 1, 2019-10-02 ...
Read more >stripe-js - githubmemory
Use discriminated unions to easier make distinction between types. yonatanhakatan ... Broken typings for StripeAuBankAccountElement when using StripeElement.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Basically this, I can post some code when I get back to the project but this essentially covers it.
What a coincidence!! I have opened an issue on react-stripe-js yesterday. @christopher-stripe This is one of the examples causing the error https://github.com/stripe/react-stripe-js/blob/master/examples/hooks/2-Split-Card.js . I have tried the example on npm homepage and sandbox as well. Same goes for them