-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
TabsProps.onChange TypeScript type is unsatisfiable/incorrect #17503
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
Comments
Could you include code that passes typescript but should be rejected? Or is there code that is rejected that should pass in your opinion? |
This worked with previous versions:
|
Same problem here since 4.4.1 and newer. |
I found that I'm only getting this error when using TabProps while wrapping the Tabs component. |
I believe it's a duplicate of #17454. |
Current Behavior 😯
The typescript type for
TabsProps<{}>.onChange
is as follows:((event: ChangeEvent<{}>, value: any) => void) & ((event: FormEvent<HTMLButtonElement>) => void)
This seems incorrect, since it is an intersection type of two function types with different signatures.
I believe this was introduced in this commit:
225badb#diff-c95eab2a6e6470acd8e136b01b514471R42
Expected Behavior 🤔
I think that the left type in the intersection (
((event: ChangeEvent<{}>, value: any) => void)
) is correct.Steps to Reproduce 🕹
@material-ui/types
4.1.1
Your Environment 🌎
@material-ui/types: 4.1.1
The text was updated successfully, but these errors were encountered: