diff --git a/types/react-stripe-elements/index.d.ts b/types/react-stripe-elements/index.d.ts index 664bf16b84..0aed8b20ff 100644 --- a/types/react-stripe-elements/index.d.ts +++ b/types/react-stripe-elements/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-stripe-elements 1.3 +// Type definitions for react-stripe-elements 6.0 // Project: https://github.com/stripe/react-stripe-elements#readme // Definitions by: dan-j // Santiago Doldan @@ -9,6 +9,7 @@ // Victor Irzak // Alex Price // Maciej Dabek +// Hiroshi Ioka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -64,7 +65,8 @@ export namespace ReactStripeElements { } interface InjectedStripeProps { - stripe?: StripeProps; + stripe: StripeProps | null; + elements: stripe.elements.Elements | null; } interface ElementProps extends ElementsOptions { diff --git a/types/react-stripe-elements/react-stripe-elements-tests.tsx b/types/react-stripe-elements/react-stripe-elements-tests.tsx index 2fd3b52b88..a757bb9ac4 100644 --- a/types/react-stripe-elements/react-stripe-elements-tests.tsx +++ b/types/react-stripe-elements/react-stripe-elements-tests.tsx @@ -139,6 +139,8 @@ class WrappedComponent extends React.Component { + const elements = this.props.elements; + this.props .stripe!.createToken({ name: '',