[Radio] "Invalid value for prop value
on <button>
tag"
#1696
Labels
bug 🐛
Something doesn't work
component: radio
This is the name of the generic UI component, not the React module!
Bug report
Current behavior
When using an object for the
value
prop ofRadio.Root
(as seems to be allowed), it attempts to render that object in thevalue
attribute of the underlying<button>
element.Also, when using the
render
function prop ofRadio.Root
,value
is part of the passedprops
(the first argument), and I don't think it should be (regardless of the type), asvalue
may not even be a valid attribute for the element we want to render (e.g.div
) – maybe it could be instate
though (the second argument)?Expected behavior
Don't include
value
in the props that are spread onto the<button>
/ passed to therender
function.Reproducible example
https://codesandbox.io/p/devbox/currying-wood-qyshll?workspaceId=ws_VCLs2BtBqfm4WA73jXMWhM
The first option's
<button>
hasvalue="[object Object]"
and the second one, which uses therender
function, has the same on a<div>
element wherevalue
is not valid.Note that the title of this issue is a warning I get in Storybook when the same issue occurs, but I don't get it in CodeSandbox for some reason.
Base UI version
1.0.0-alpha.7
Which browser are you using?
Chrome, Safari, and Firefox
Which OS are you using?
macOS
Which assistive tech are you using (if applicable)?
None
The text was updated successfully, but these errors were encountered: