Question regarding how the primitive component are typed #2495
Unanswered
ladislasdellinger
asked this question in
Help
Replies: 1 comment 2 replies
-
I briefly tried it but it seems TS can't resolve it properly for the default case when |
Beta Was this translation helpful? Give feedback.
2 replies
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.
-
Hello everyone,
I have a question regarding how the Radix Primitive component props are typed. As you may know, when asChild === false, Radix renders a default HTML element. For example, if we consider the DropdownMenuRadioGroup element, the props currently look like this:
This means that even when asChild === true and the component doesn't render the underlying div, it still accepts all the props from the base div.
I was wondering if there might be a way to improve the typing by creating a structure like this, or if I might be missing something in the asChild pattern:
Any insights or suggestions would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions