My React component, called "Badge", returns text that has bold styling.
render() {
return (
<div>
<Text weight={'bold'}>
{this.props.label}
</Text>
</div>
)
Now, I am using the "Badge" component within another one named "Card".
Since all text in the Badge component is styled as bold, any sentence it renders will also be in bold:
return (
<div>
<Badge label={'This part of the sentence is ' + 'normal font style' + ' and the rest is bold.'}></Badge>
</div>
)
I want to style specific parts of this element differently, so I attempted to remove the bold style from 'normal font style' - just for this segment. However, my current approach isn't working:
<Badge label={'This part of the sentence is ' + <span class=”normalText”>'normal font style'</span> + 'and the rest is bold.'}></Badge>
As a beginner, I find this issue quite frustrating. Any suggestions on how to tackle this problem?