-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[typescript] Fix keyof for [email protected] #11669
Conversation
packages/material-ui/src/index.d.ts
Outdated
@@ -7,7 +7,7 @@ export { StyledComponentProps }; | |||
* certain `classes`, on which one can also set a top-level `className` and inline | |||
* `style`. | |||
*/ | |||
export type StandardProps<C, ClassKey extends string, Removals extends keyof C = never> = Omit< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just redefine Omit
to allow using any valid key type?
export type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It is better. Thank you! 👍
Thanks! |
I am still having the same issue in |
@activebiz Thats right. Could you also provide your TS version, |
@mctep thanks If I revert the TS to 2.8.4 I get following: ` node_modules/@material-ui/core/ButtonBase/ButtonBase.d.ts
Thanks |
@activebiz Looks like that it is not the same issues. Which versions of |
Same as in issue #11671 here. |
@mctep, @activebiz see issue #11698 |
thanks @Ritorna. Now those errors are gone but got hundreds of new errors. Looks like something wrong with my tsconfig. would you mind sharing your tsconfig ? Here's mine
|
@activebiz i guess it mainly depends on which modules you import :/ Here you are: Alternatively you may use |
Looks like it cannot correctly infer type def when export component with compose helper.
It will works if you just It also doesn't work with other HOC such as redux |
* fix keyof for ts 2.9 * extends keyof any in omit
Fixes #11656