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
I started to use the new Flow types into my project, and I figured out it would make sense to make StyledComponent a polymorphic type, so that we can do this:
allow to workaround the lack of tagged template support of Flow
Unfortunately I doubt my Flow knowledge is good enough to implement this without breaking the existing types, which make sense because we also want to allow:
Well, I'm not sure if there is anyone other than you willing to jump on this. This definitely makes sense, I just don't have enough expertise with flow to implement this myself. I also don't understand how those types were used so far, so it's hard to assess what might be breaking and what is not.
I'm not against breaking changes in types though - I believe that we can release type changes each minor version~ (it's completely unergonomic to make them bump major versions).
I think it could be enough to change the CreateStyled call signature, while leaving the [key: string]: ... type as is it now.
That way we can still do styled.div<Props>(), we can do styled<Props>(fn)(), but we'll not be allowed to do styled(fn)<Props>() (which I think would be okay).
I started to use the new Flow types into my project, and I figured out it would make sense to make
StyledComponent
a polymorphic type, so that we can do this:Which would allow to:
props
inside the styled component logicUnfortunately I doubt my Flow knowledge is good enough to implement this without breaking the existing types, which make sense because we also want to allow:
What do you think?
The text was updated successfully, but these errors were encountered: