Reputation:
I can't for the life of me figure out what type I should be using for this import:
import { CardElement } from '@stripe/react-stripe-js';
For the stripe
and elements
props you drill from the consumer and for the optional token object for example I used these types correctly:
import { Stripe, StripeElements, CreateTokenCardData } from '@stripe/stripe-js';
but for CardElement
I just can't find the right type to use. I looked at the definition files inside node_modules/@stripe/stripe-js
as well as node_modules/@stripe/react-stripe-js
but no luck.
Does anyone know?
Upvotes: 0
Views: 2148
Reputation: 3260
...but for CardElement I just can't find the right type to use.
The type you're looking for is likely the CardElementComponent
type, which you can import along with the component as follows:
import { CardElement, CardElementComponent } from "@stripe/react-stripe-js";
You can reference the type definition, along with the type definitions of all the other components included in @stripe/react-stripe-js
in this file here:
Upvotes: 1