We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ee3cf3 commit ea5d086Copy full SHA for ea5d086
src/Variation.tsx
@@ -16,15 +16,13 @@
16
import * as React from 'react';
17
18
export type VariationProps = {
19
- variation?: any;
+ variation?: string;
20
default?: any;
21
children?: React.ReactNode;
22
};
23
24
-class Variation extends React.Component<VariationProps, {}> {
25
- render() {
26
- return this.props.children;
27
- }
28
-}
+// Wrap the return value here in a Fragment to please the HOC's expected React.ComponentType
+// See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051
+const Variation: React.FunctionComponent<VariationProps> = ({ children }) => <>{children}</>;
29
30
export const OptimizelyVariation = Variation;
0 commit comments