-
-
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
[styled-engine] Drop withComponent support #27780
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -77,17 +77,7 @@ export type Overwrapped<T, U> = Pick<T, Extract<keyof T, keyof U>>; | |||||||||||||||||
|
||||||||||||||||||
export interface StyledComponent<InnerProps, StyleProps, Theme extends object> | ||||||||||||||||||
extends React.FunctionComponent<InnerProps & StyleProps & { theme?: Theme }>, | ||||||||||||||||||
ComponentSelector { | ||||||||||||||||||
/** | ||||||||||||||||||
* @desc this method is type-unsafe | ||||||||||||||||||
*/ | ||||||||||||||||||
withComponent<NewTag extends keyof JSX.IntrinsicElements>( | ||||||||||||||||||
tag: NewTag, | ||||||||||||||||||
): StyledComponent<JSX.IntrinsicElements[NewTag], StyleProps, Theme>; | ||||||||||||||||||
withComponent<Tag extends React.JSXElementConstructor<any>>( | ||||||||||||||||||
tag: Tag, | ||||||||||||||||||
): StyledComponent<PropsOf<Tag>, StyleProps, Theme>; | ||||||||||||||||||
} | ||||||||||||||||||
ComponentSelector {} | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to push it the extra mile with the tradeoff of @dimitropoulos in #20012 (comment)?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, it doesn't work in this context. It would silence the missing support in TypeScript. |
||||||||||||||||||
|
||||||||||||||||||
export interface StyledOptions { | ||||||||||||||||||
label?: string; | ||||||||||||||||||
|
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.
isn't this the equivalent?
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.
I imagine the equivalent is :
but there is already an
as
prop coming from the navigation that conflicts, e.g.as: '/api/accordion'
so it doesn't work.