mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
types/react-stripe-elements: add InjectedStripeProps.elements (#40971)
This commit is contained in:
+4
-2
@@ -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: '',
|
||||
|
||||
Reference in New Issue
Block a user