diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index 8faaa640bb..a483f96b05 100644 --- a/types/styled-components/index.d.ts +++ b/types/styled-components/index.d.ts @@ -346,7 +346,7 @@ export type ThemedCssFunction = BaseThemedCssFunction< >; // Helper type operators -type Omit = Pick>; +type Omit = T extends any ? Pick> : never; type WithOptionalTheme

= Omit & { theme?: T; }; diff --git a/types/styled-components/test/index.tsx b/types/styled-components/test/index.tsx index a2a8f7f1a4..eaa43ee491 100644 --- a/types/styled-components/test/index.tsx +++ b/types/styled-components/test/index.tsx @@ -1052,8 +1052,7 @@ function unionTest() { font-size: ${props => props.kind === 'book' ? 16 : 14} `; - // undesired, fix was reverted because of https://github.com/Microsoft/TypeScript/issues/30663 - ; // $ExpectError + ; ; // $ExpectError }