diff --git a/types/styled-components/index.d.ts b/types/styled-components/index.d.ts index a483f96b05..8faaa640bb 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 = T extends any ? Pick> : never; +type Omit = Pick>; type WithOptionalTheme

= Omit & { theme?: T; }; diff --git a/types/styled-components/test/index.tsx b/types/styled-components/test/index.tsx index eaa43ee491..a2a8f7f1a4 100644 --- a/types/styled-components/test/index.tsx +++ b/types/styled-components/test/index.tsx @@ -1052,7 +1052,8 @@ 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 }