-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type definitions for onBlur
and onFocus
are incorrect
#105
Comments
Thanks for reporting. It looks like the event handler type is also not correctly documented in the base library (e.g. https://github.com/stripe/stripe-js/blob/master/types/stripe-js/elements/card.d.ts) We'll look into fixing those definitions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The type defs are still incorrect here. Can we re-open in case someone has time to take a look? Thanks! |
Thanks for flagging @madisonbullard, I agree that this should get fixed! |
Hi @madisonbullard, this has been fixed in 1.15.1. |
Wait. This is still not fixed in this library, isn't it? |
Can confirm in late 2022 that the type definitions are still incorrect. |
Should be fixed! Fix will deploy later today |
https://github.com/stripe/react-stripe-js/blob/master/src/types/index.ts#L18
https://github.com/stripe/react-stripe-js/blob/master/src/types/index.ts#L23
The type definitions do not properly define the argument passed to
onBlur
andonFocus
props. Both functions are called with a single argument with the following shape:{ elementType: 'card' | 'cardNumber' | 'cardExpiry' | 'cardCvc' }
I might've missed some possible options, but I know that those 4 are valid.
Can we update the types to reflect the function signature?
The text was updated successfully, but these errors were encountered: