@kablamo/kerosene-test
Advanced tools
Comparing version 0.0.4 to 0.0.5
import * as React from "react"; | ||
export default function createStubComponent<Props extends {} = { | ||
[prop: string]: unknown; | ||
}, RenderProps extends any[] = any[]>(displayName: string, functional?: false): React.ComponentClass<Props>; | ||
}, RenderProps extends readonly any[] = any[]>(displayName: string, functional?: false): React.ComponentClass<Props>; | ||
export default function createStubComponent<Props extends {} = { | ||
[prop: string]: unknown; | ||
}, RenderProps extends any[] = any[]>(displayName: string, functional: true): React.FunctionComponent<Props>; | ||
}, RenderProps extends readonly any[] = any[]>(displayName: string, functional: true): React.FunctionComponent<Props>; | ||
export default function createStubComponent<Props extends {} = { | ||
[prop: string]: unknown; | ||
}, RenderProps extends any[] = any[]>(displayName: string, functional: false | undefined, getRenderProps: () => RenderProps, transformRenderPropResult?: (result: (props: any) => React.ReactNode) => React.ReactNode): React.ComponentClass<Props & { | ||
}, RenderProps extends readonly any[] = any[]>(displayName: string, functional: false | undefined, getRenderProps: (props: Omit<Props, "children">) => RenderProps, transformRenderPropResult?: (result: (props: any) => React.ReactNode) => React.ReactNode): React.ComponentClass<Props & { | ||
children: (...args: RenderProps) => React.ReactNode; | ||
@@ -15,4 +15,4 @@ }>; | ||
[prop: string]: unknown; | ||
}, RenderProps extends any[] = any[]>(displayName: string, functional: true, getRenderProps: () => RenderProps, transformRenderPropResult?: (result: (props: any) => React.ReactNode) => React.ReactNode): React.FunctionComponent<Props & { | ||
}, RenderProps extends readonly any[] = any[]>(displayName: string, functional: true, getRenderProps: (props: Omit<Props, "children">) => RenderProps, transformRenderPropResult?: (result: (props: any) => React.ReactNode) => React.ReactNode): React.FunctionComponent<Props & { | ||
children: (...args: RenderProps) => React.ReactNode; | ||
}>; |
@@ -24,3 +24,3 @@ "use strict"; | ||
return Object.assign(({ children, ...props }) => (React.createElement("div", Object.assign({ __displayName__: displayName }, props), typeof children === "function" | ||
? transformRenderPropResult(children(...getRenderProps())) | ||
? transformRenderPropResult(children(...getRenderProps(props))) | ||
: children)), { displayName }); | ||
@@ -32,3 +32,3 @@ } | ||
return (React.createElement("div", Object.assign({ __displayName__: displayName }, props), typeof children === "function" | ||
? transformRenderPropResult(children(...getRenderProps())) | ||
? transformRenderPropResult(children(...getRenderProps(props))) | ||
: children)); | ||
@@ -35,0 +35,0 @@ } |
{ | ||
"name": "@kablamo/kerosene-test", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21733
434