Closed
Description
Package
@carbon/react
Browser
Chrome
Package version
v11.58.1
React version
v1.58.1
Description
When I pass a null child to a RadioButtonGroup, it crashes. This is because of this line:
const { value } = (radioButton as ReactElement)?.props ?? undefined;
which attempts to destructure undefined
Reproduction/example
https://stackblitz.com/edit/github-drap92?file=src%2FApp.jsx
Steps to reproduce
<div>
hi
<RadioButtonGroup name="foo">
<RadioButton labelText="hey" />
{null}
</RadioButtonGroup>
</div>
Suggested Severity
Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.
Application/PAL
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate problems
Metadata
Metadata
Assignees
Type
Projects
Status
✅ Done