Created
February 26, 2019 07:45
-
-
Save michal-wrzosek/d4e3ce0865c5129e34ff0bfd9ab43861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>; | |
type ExampleProps = { | |
items: string[]; | |
providedByHOC: string; | |
alsoProvidedByHOC: number; | |
}; | |
type ExamplePropsWithoutHOCProps = Omit<ExampleProps, 'providedByHOC' | 'alsoProvidedByHOC'>; | |
// If your HOC props are typed you can also do: | |
type PropsProvidedByHOC = { | |
providedByHOC: string; | |
alsoProvidedByHOC: number; | |
}; | |
type AnotherExamplePropsWithoutHOCProps = Omit<ExampleProps, keyof PropsProvidedByHOC>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment