I would be interested to see if the label prop of the RadioButton could accept a ReactNode instead of a string.
An example of what I want to achieve is shown in the screenshot, where I have some additional text with a different styling. Or even a text input. This is from a webapp.
This would also allow people to use any themed Text components they might have, without having to override the labelStyle prop.
Hey,
I would be interested to see if the
label
prop of theRadioButton
could accept aReactNode
instead of a string.An example of what I want to achieve is shown in the screenshot, where I have some additional text with a different styling. Or even a text input. This is from a webapp. This would also allow people to use any themed
Text
components they might have, without having to override thelabelStyle
prop.I reckon, the code would look something like
This should keep it backwards compatible.
The docs then should probably state, that
labelStyle
is ignored if thelabel
Prop is not a string.A similar thing could be done for the
description
prop.I would be willing to contribute a PR for this.