You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[all components] Decide on a common generic value type #1076
We can't use unknown because it comes with a difficult DX
any is OK but might be a footgun with non-primitive values causing unexpected rerenders due to different references. I could go either way though as it's more powerful too.
Any potential issues with non-primitive values in forms?
Toggle needs to align with whatever everything else is using
Select.Value needs to use the actual value type for the children render function
Search keywords:
Reacted by Chaz Gatian, Alexandru Ţurcanu, Nikita Pashinsky, Yashu Mittal, Leong Qi Jin (Michael) and Mihail
I'm a consumer of Base UI here. I've discovered that many of the value props cannot be typed. It would be ideal if some props could take a generic T to specify the type.
This is a problem when implementing components, such as RadioGroup, especially when using onValueChange, which ends up with a following TypeScript error, and cannot be side-stepped.
Activity
[-]Decide on a common generic value type[/-][+]Decide on a common generic `value` type[/+]cgatian commentedon May 22, 2025
I'm a consumer of Base UI here. I've discovered that many of the
valueprops cannot be typed. It would be ideal if some props could take a genericTto specify the type.mj12albert commentedon May 28, 2025
@cgatian Thanks for using Base UI ~ could you share a bit more about use-cases where this is an issue for you and which components?
matthewmorek commentedon Sep 29, 2025
This is a problem when implementing components, such as
RadioGroup, especially when usingonValueChange, which ends up with a following TypeScript error, and cannot be side-stepped.mj12albert commentedon Sep 29, 2025
For RadioGroup we could change it from unknown to string to match Checkbox(Group)
benface commentedon Dec 19, 2025
I was hoping you would do the other way around @mj12albert, i.e. support non-string values in Checkbox(Group). 🫠
atomiks commentedon Dec 19, 2025
The type for
RadioGroup(until there are generics for allvalues) should at least beany, which matchesMenu.RadioGroup, notunknown.[-]Decide on a common generic `value` type[/-][+][all components] Decide on a common generic `value` type[/+]