-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix mismatch between CSSInterpolation and Interpolation<Props> #3164
Changes from all commits
c44db7f
adabfd2
847668c
7096107
2a76367
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@emotion/serialize': patch | ||
--- | ||
|
||
Make `ArrayInterpolation` to extend `ReadonlyArray` to match a similar recent change to `ArrayCSSInterpolation`. It fixes some compatibility issues when those 2 get mixed together. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@emotion/styled": patch | ||
--- | ||
|
||
Reordered `styled` overloads to accommodate the recent change in `@emotion/serialize`'s types. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,10 +63,18 @@ export interface CreateStyledComponent< | |
SpecificComponentProps extends {} = {}, | ||
JSXProps extends {} = {} | ||
> { | ||
( | ||
template: TemplateStringsArray, | ||
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. I see where you are going with this reordering and I think it makes sense. However, I'm really anxious about reordering those overloads. This change needs some extra coverage in our type tests. 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. Oh, I misunderstood this in part - this is actually a fix for existing tests (that became import after the change in |
||
...styles: Array< | ||
Interpolation<ComponentProps & SpecificComponentProps & { theme: Theme }> | ||
> | ||
): StyledComponent<ComponentProps, SpecificComponentProps, JSXProps> | ||
|
||
/** | ||
* @typeparam AdditionalProps Additional props to add to your styled component | ||
*/ | ||
<AdditionalProps extends {} = {}>( | ||
<AdditionalProps extends {}>( | ||
template: TemplateStringsArray, | ||
...styles: Array< | ||
Interpolation< | ||
ComponentProps & | ||
|
@@ -80,18 +88,10 @@ export interface CreateStyledComponent< | |
JSXProps | ||
> | ||
|
||
( | ||
template: TemplateStringsArray, | ||
...styles: Array< | ||
Interpolation<ComponentProps & SpecificComponentProps & { theme: Theme }> | ||
> | ||
): StyledComponent<ComponentProps, SpecificComponentProps, JSXProps> | ||
|
||
/** | ||
* @typeparam AdditionalProps Additional props to add to your styled component | ||
*/ | ||
<AdditionalProps extends {}>( | ||
template: TemplateStringsArray, | ||
<AdditionalProps extends {} = {}>( | ||
...styles: Array< | ||
Interpolation< | ||
ComponentProps & | ||
|
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.
this makes sense to me, it shouldnt hurt us anyhow