New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New variants api and type fixes #134
Conversation
@christianalfoni would you mind having a look as well, pleeeeease? 🙏 |
regarding the variant API, thanks for that, im looking at the codesandbox and doing some tests So to clarify, in order for types to work properly, the variant calls need to be chained.
Instead of the original idea, which was to have completely seperate blocks:
Personally, Im not a fan of chaining, but I could live with it. What worries me the most is the confusion around the fact that types will not work unless you chain. These things become really hard to document, and will drive people nuts. Because from a technical perspective, you’d think that if you can chain, you can also call Button.variant - which you can, but… types wont work |
typing stuff seems to be working very well though |
What's inside:
Updated variants api according to Update the variant syntax #85We went with a new syntax since the syntax suggested in Update the variant syntax #85 can't be typed unless chained:
new variant syntax:
forwardRef
#71children: never
when usingstyled(Component, {})
TS: expectschildren: never
when usingstyled(Component, {})
#96with both of the options being strictly typed to the actual values
Please hammer this down with testing for both typing and actual functionality as there was a fair bit of types/functionality was re-written and we currently don't have testing setup for the styled package so play around with it and let me know if you find any bugs