diff --git a/packages/react/src/styled.ts b/packages/react/src/styled.ts index 3f755c7f6..676c7537c 100644 --- a/packages/react/src/styled.ts +++ b/packages/react/src/styled.ts @@ -128,7 +128,7 @@ function styled< >( componentWithoutStyle: TConstructor & Component ): ComponentStyledTagWithoutInterpolation; -function styled( +function styled( tag: TName ): HtmlStyledTag; function styled( @@ -244,7 +244,7 @@ export type StyledComponent = WYWEvalMeta & type StaticPlaceholder = string | number | CSSProperties | WYWEvalMeta; -export type HtmlStyledTag = < +export type HtmlStyledTag = < TAdditionalProps = Record, >( strings: TemplateStringsArray, @@ -253,10 +253,10 @@ export type HtmlStyledTag = < | (( // Without Omit here TS tries to infer TAdditionalProps // from a component passed for interpolation - props: JSX.IntrinsicElements[TName] & Omit + props: React.JSX.IntrinsicElements[TName] & Omit ) => string | number) > -) => StyledComponent; +) => StyledComponent; type ComponentStyledTagWithoutInterpolation = ( strings: TemplateStringsArray, @@ -278,14 +278,14 @@ type ComponentStyledTagWithInterpolation = ( : StyledComponent; export type StyledJSXIntrinsics = { - readonly [P in keyof JSX.IntrinsicElements]: HtmlStyledTag

; + readonly [P in keyof React.JSX.IntrinsicElements]: HtmlStyledTag

; }; export type Styled = typeof styled & StyledJSXIntrinsics; export default (process.env.NODE_ENV !== 'production' ? new Proxy(styled, { - get(o, prop: keyof JSX.IntrinsicElements) { + get(o, prop: keyof React.JSX.IntrinsicElements) { return o(prop); }, })