-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: null child crashes RadioButtonGroup (#16655) #16691
Conversation
All contributors have signed the DCO. |
I have read the DCO document and I hereby sign the DCO. |
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @brandones .
Thanks for raising this bug and it's fix.
Just trying to understand the use case of below code
<div>
hi
<RadioButtonGroup name="foo">
<RadioButton labelText="hey" />
{null}
</RadioButtonGroup>
</div>
@2nikhiltom This kind of thing comes up often when options are not hard-coded.
Whether you use Also your library simply should not crash with a TypeError on what React considers well-structured input :) |
Hey @brandones ! This looks great, could you resolve conflicts in the branch? |
Got swooped by @cuppajoey , e582548 . So here's a test if you want it :) |
929b3bb
Closes #16655
Passing
null
as a child of aRadioButtonGroup
would cause a crash.Changelog
Changed
This code will no longer crash:
Testing / Reviewing
Try the above code. I included a test.