TypeScript types for slot values? #8839
DarkstarXDD
started this conversation in
General
Replies: 1 comment 1 reply
-
Thanks for the discussion, we've recently begun discussing ways to do this, possibly with component specific attributes
Just doing the strings is a little difficult because you have to know what component you're in. So something like the above would make that more obvious. We haven't quite settled on how we'll do it, but welcome thoughts and other ideas. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, I don't really have an understanding how things are setup under the hood and whether this is possible or not.
But is it not possible to get types for the
slot
values? They use a fixed set of strings right? Like "description", "increment" etc. So can't those be a union of literal types? That way we can see all the possible values when working with theslot
prop.Again, it's probably way more complex under the hood and it's not possible, but I just wanted to ask. Because currently there's no autocomplete when we type a value for the
slot
prop and there is a chance we can mistype the string.Beta Was this translation helpful? Give feedback.
All reactions