-
-
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
[Paper] Typing error when trying to pass component
to PaperProps
of Drawer
#32404
Conversation
This is the type of Paper component:
What I'm saying is that this isn't probably how it should be fixed but I'm not advanced enough in TS to do a PR myself. |
Note that, this pattern is used in all components that support the Overall, I think that we should not use the |
I think this approach is a workaround which is fine. To really fix the underlying problem, we have to revisit the |
This fix won't let the user to use |
@mnajdova In the DataGrid we use the |
98d0592
to
75999c7
Compare
@m4theushw Thanks I just applied the diff |
The following should output typescript error, but it doesn't because of the change in this PR ( const CustomComponent: React.FC<{ stringProp: string; numberProp: number }> = () => <div />;
<AppBar component={CustomComponent} /> |
Closes #27703
Closes #32392
Problem:
PaperProps
doesn't havecomponent
as a key<Drawer PaperProps={{ component:"..." }} ... />
displays a Typescript error<Dialog PaperProps={{ component:"..." }} ... />
displays a Typescript errorBefore:
After: