Skip to content

Type definitions for onBlur and onFocus are incorrect #105

@madisonbullard

Description

@madisonbullard

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 and onFocus 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions