types/react-stripe-elements: add InjectedStripeProps.elements (#40971)

This commit is contained in:
hirochachacha
2019-12-13 09:35:33 +00:00
committed by Orta
parent e6f3bd1b96
commit 02549c083e
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -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 <https://github.com/dan-j>
// Santiago Doldan <https://github.com/santiagodoldan>
@@ -9,6 +9,7 @@
// Victor Irzak <https://github.com/virzak>
// Alex Price <https://github.com/remotealex>
// Maciej Dabek <https://github.com/bombek92>
// Hiroshi Ioka <https://github.com/hirochachacha>
// 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 {
@@ -139,6 +139,8 @@ class WrappedComponent extends React.Component<ComponentProps & InjectedStripePr
}
onSubmit = () => {
const elements = this.props.elements;
this.props
.stripe!.createToken({
name: '',