diff --git a/package-lock.json b/package-lock.json index 4c483b23..12ecf2db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "twin.macro", "version": "3.4.0", "license": "MIT", "dependencies": { diff --git a/types/index.d.ts b/types/index.d.ts index e1a80595..d66f0cef 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,4 @@ -import { ComponentType } from 'react' +import { ComponentType, ElementType } from 'react' import { Config as TailwindConfig } from 'tailwindcss' export interface TwStyle { @@ -26,7 +26,7 @@ export type ScreenFn = ( ) => (styles?: string | TemplateStringsArray | TwStyle | TwStyle[]) => T export type TwComponent = ( - props: JSX.IntrinsicElements[K] + props: JSX.IntrinsicElements[K] & { as?: ElementType } ) => JSX.Element export type TwComponentMap = { diff --git a/types/tests/basic/index.tsx b/types/tests/basic/index.tsx index 3324e030..5ea98bd6 100644 --- a/types/tests/basic/index.tsx +++ b/types/tests/basic/index.tsx @@ -52,3 +52,7 @@ const twProperty = ( ) const csProperty =
+const asProperty =