-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(radio): add typescript support for accepting react node #200
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
recheck |
size-limit report 📦
|
@@ -45,7 +45,7 @@ export type RadioProps = { | |||
/** | |||
* The actual text to be displayed `Cats For Adoptions` | |||
*/ | |||
label: string; | |||
label: string | ReactNode; |
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.
I'm okay with this but note that this has a bit of a11y implications. Can you double check that the text node of whatever react node you pass in get's read in for a11y?
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.
Verified with Chrome Lighthouse that there were no accessibility issues using a node. From the code, it looks like all aria
values are appended using the value
prop being passed in, so the label
being a node should not affect (unless the node being passed in does not pass a11y)
@bbleungg spelling error in the title of the PR |
This change adds Typescript support for
Radio
label accepting a React node