mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Options are spread into props.
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ export namespace ReactStripeElements {
|
||||
interface StripeProviderOptions {
|
||||
stripeAccount?: string;
|
||||
}
|
||||
type StripeProviderProps = { apiKey: string; stripe?: never; options?: StripeProviderOptions } | { apiKey?: never; stripe: StripeProps | null; options?: StripeProviderOptions; };
|
||||
type StripeProviderProps = { apiKey: string; stripe?: never; } & StripeProviderOptions | { apiKey?: never; stripe: StripeProps | null; } & StripeProviderOptions;
|
||||
|
||||
interface StripeProps {
|
||||
createSource(sourceData?: SourceOptions): Promise<SourceResponse>;
|
||||
|
||||
@@ -197,6 +197,7 @@ const TestStripeProviderProps3: React.SFC<{
|
||||
}> = props => <StripeProvider stripe={null} />;
|
||||
|
||||
/**
|
||||
* StripeProvider should be able to accept an `options` prop
|
||||
* StripeProvider should be able to accept options.
|
||||
* See: https://stripe.com/docs/stripe-js/reference#stripe-function for options.
|
||||
*/
|
||||
const TestStripeProviderOptions: React.SFC = () => <StripeProvider apiKey="" options={{stripeAccount: ""}} />;
|
||||
const TestStripeProviderOptions: React.SFC = () => <StripeProvider apiKey="" stripeAccount="" />;
|
||||
|
||||
Reference in New Issue
Block a user