Conversation
| // Distribute unions early to avoid quadratic expansion | ||
| P extends any ? OmitU<ReactDefaultizedProps<C, P> & O, A> & Partial<PickU<P & O, A>> : never; | ||
|
|
||
| export type StyledComponentProps< |
There was a problem hiding this comment.
This is a bit overwhelming to add to the list of things to maintain
There was a problem hiding this comment.
I think so too (I thought it was difficult when I wrote it)
I'm having a hard time deciding how to maintain this complicated type definition, or considering alternatives, so I'd like some advice.
what do you think you should do
| | InterpolationFunction<Props> | ||
| | FlattenInterpolation<Props>; | ||
|
|
||
| export type InterpolationFunction<P extends object> = (props: P) => Interpolation<P>; |
There was a problem hiding this comment.
InterpolationFunction and other types here looks like they come from the Definitely Typed definitions for v5.
InterpolationFunction from v5 can be replaced with StyleFunction from v6.
Maybe we can either write a migration guide from v5 to v6, or consider just aliasing some of the types that are 1 to 1 replacements?
I don't think we should copy all of the types over from Definitely Typed because there are new, similar types defined in v6. It might get really confusing to maintain two very similar copies of the same type but with different names.
There was a problem hiding this comment.
Oh, sorry, and thank you!!
I didn't realize the new types were defined because I only referred to the migration guide to define the types.
consider just aliasing some of the types that are 1 to 1 replacements?
For now, I'll try aliasing some of the types that are 1 to 1 replacements. thank you!!
refs #4062 #4117 #4126
Add more missing types in addition to #4126.
I added some of them.
I also added the types they depend on.
referenced here https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/styled-components/index.d.ts