You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix mismatch between CSSInterpolation and Interpolation<Props> (#3164)
* Add explicit test for uncovered regression; fix interpolation type to make it pass
* Reorder overloads for styled component creator
Formerly, the first overload to be tried was not accepting template strings array as first argument. Therefore, it couldn't be used when `styled` was used as a tag for template string. So in this case TS skipped this overload and fell through to the next.
Now, though, with `ArrayInterpolation` type changed, `TemplateStringsArray` matches the definition of `ArrayInterpolation`; therefore, this overload becomes used for template strings, confusing type inference.
This change moves this overload to the end of the list, i.e. to be used as fallback when there's actually a direct function call, without template string.
* yarn changeset
* Apply suggestions from code review
* Create tiny-snails-watch.md
---------
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Make `ArrayInterpolation` to extend `ReadonlyArray` to match a similar recent change to `ArrayCSSInterpolation`. It fixes some compatibility issues when those 2 get mixed together.
0 commit comments