-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[system] Fix changed types between 5.14.0 and 5.14.1 #39288
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
Conversation
Co-authored-by: seunexplicit <[email protected]>
Netlify deploy previewhttps://deploy-preview-39288--material-ui.netlify.app/ Bundle size report |
@DiegoAndai this PR is ready for review |
Hey @gitstart, thanks for working on this. Could you explain in depth how these changes fix the issue? It would make reviewing the typing change way easier. |
@DiegoAndai Based on the details provided in the issue, it seems that the newly introduced component props in this location were preventing the styled component from accessing the correct typings as seen here. We suspect that the issue might have been related to this definition. Given that the generic Props type wasn't utilized, it would default to any type as seen here. To address this, we decided to explicitly include the component typing in the type definition. However, there's still some uncertainty regarding why this definition wasn't inferred as React.ComponentProps. Ideally, it should have been sufficient to account for the introduction of the component props. |
@gitstart, thanks for the explanation. Sadly, I don't have access to any of the links 😅 Seems like these are under About this change: <
C extends React.JSXElementConstructor<React.ComponentProps<C>>,
- ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>,
+ RootComponent extends React.ElementType = React.ElementType,
+ ForwardedProps extends keyof OverriddableForwardProps<
+ C,
+ RootComponent
+ > = keyof OverriddableForwardProps<C, RootComponent>,
>( This means that now the third argument is the forwarded props, right? Why is that? Maybe that's the cause of our issue |
@DiegoAndai The links on the comment have been updated, apologies for the oversight. |
@gitstart so what do you think about this: <
C extends React.JSXElementConstructor<React.ComponentProps<C>>,
- ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>,
+ RootComponent extends React.ElementType = React.ElementType,
+ ForwardedProps extends keyof OverriddableForwardProps<
+ C,
+ RootComponent
+ > = keyof OverriddableForwardProps<C, RootComponent>,
>( From what I understand, this means that now the third argument is the forwarded props, right? Why is that? Maybe if we figure out why, we could pinpoint the root cause of the issue. |
@DiegoAndai The reason why |
@gitstart then my question is why this change made the |
Description
Update the styled component typing to include component prop typing.
closes #38626
This code was written and reviewed by GitStart Community. Growing great engineers, one PR at a time.