ab-test-jsx
Version:
React (JS) AB testing consumption
7 lines (6 loc) • 711 B
TypeScript
import * as React from 'react';
import { ABTests } from '../ABTestsContext';
export declare type withABTestsProviderHoC<T extends ABTests> = <TProps extends Record<string, unknown>>(Component: React.ComponentType<TProps>, abTests: T | ABTestsSetter<TProps, T>, defaultVariant?: 'A' | 'B' | 'Z') => React.FunctionComponent<TProps>;
declare type ABTestsSetter<TProps extends Record<string, unknown>, T> = (componentProps: TProps) => T;
declare const withABTestsProvider: <T extends ABTests, TProps extends Record<string, unknown>>(Component: React.ComponentType<TProps>, abTests: T | ABTestsSetter<TProps, T>, defaultVariant?: "A" | "B" | "Z" | undefined) => React.FC<TProps>;
export default withABTestsProvider;