Replies: 2 comments
-
Yeah, the problem is that we have created typings for each of these props - for example, There might be a solution to that I don't know about. I would absolutely love to fix this, because I also find it unintuitive. |
Beta Was this translation helpful? Give feedback.
-
Yeah, to clarify, we can make the default types autofill and allow custom types, but the trade off is that the custom types do not auto fill (see playground link above) and it adds some typing silliness. Although, this is also a bit unintuitive. (E.g., "xl" would auto fill, but "myCustomValue" would not in "size"). I don't think there a good solution for auto filling both :/ (you could if you require filling out the entirety of a Custom Theme with Templates, but I really don't think that's a good idea) Edit: Turns out you can, but it's really really gross: Playground |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Props such as "size" in components such as "Button" do allow for typescript suggestions/autocomplete.
To Reproduce
Steps to reproduce the behavior:
<Button />
size
Expected behavior
Typings work. Without them, we lose autocomplete and any compiler checks.
Screenshots
Bug:
Expected:
System information:
Probably not indented, but here is my VSCode info.
Project information:
Additional context
This is complicated since I'm not sure the vision of themes, but ideally, I would want the defaults to work at least.
My guess on the vision is to be able to define new types and then be able to use them in component. Typings for this is fairly complicated and I couldn't find an easy way in TypeScript to help.
Here is an example of autocompleting the default types and allowing custom. Note that the custom types do not get suggested.
Playground link
Beta Was this translation helpful? Give feedback.
All reactions