Skip to content

Commit 525c4e2

Browse files
authored
fix: type $Without does not distribute over discriminated unions (#96)
1 parent 392e477 commit 525c4e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

typings/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import * as React from 'react';
55
import hoistNonReactStatics = require('./hoist-non-react-statics');
66

7-
type $Without<T, K> = Pick<T, Exclude<keyof T, K>>;
7+
type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
88
type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };
99

1010
export type ThemingType<Theme> = {

0 commit comments

Comments
 (0)