From 47a8bdda3e4d08f9163db839d5593913d5cfd8ca Mon Sep 17 00:00:00 2001 From: Clay Miller Date: Tue, 5 Nov 2019 16:28:39 -0500 Subject: [PATCH] Revert "Make 'Omit' a distributive conditional type to support union prop types. Fixes #39300. (#39323)" (#40095) This reverts commit f71b4a0526509070732d2dc4ff5dddbcc8e984fa. --- types/styled-components/index.d.ts | 2 +- types/styled-components/test/index.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 }