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
It's great, that styled-components now provide its own types. However I believe, there's a regression in comparison to @types/styled-components. My apologies in advance if I misunderstood the concept. Otherwise if the bug will be confirmed, I might consider creating a PR with a fix.
Environment
No need, since it's generic issue applicable to all typescript environments. Code sandboxes are provided below.
It's great, that styled-components now provide its own types. However I believe, there's a regression in comparison to @types/styled-components. My apologies in advance if I misunderstood the concept. Otherwise if the bug will be confirmed, I might consider creating a PR with a fix.
Environment
No need, since it's generic issue applicable to all typescript environments. Code sandboxes are provided below.
Reproduction
Please give the code sandboxes a bit of time to init the environment, so the errors shown at the beginning will disappear.
Steps to reproduce
styled
"as"
polymorphic propExpected Behavior
When using
"as"
polymorphic prop a styled component should expect properties of the passed component, not originally wrapped component.Actual Behavior
Typescript error, example from the code sandbox above:
Property 'requiredProp' is missing in type '{ children: string; as: "button"; }' but required in type 'FastOmit<Substitute<FastOmit<{ className?: string | undefined; requiredProp: string; }, never>, Substitute<{}, Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & { ...; }>>, keyof ExecutionProps>'.
The text was updated successfully, but these errors were encountered: