Proper TypeScript typings for styled
#252
enrico-mumtak
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
When using
styled, the returned component is always typed asany, so all original component props and type safety are lost.It would be great if
styledcould preserve the original component’s props and extend them with the style-related props added bystyled, instead of returningany.This would significantly improve TypeScript support and DX.
Is this a known limitation or something that could be improved in the future?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions