// FormattedMessage is from react-intl and renders as <span>dummy</span>
<Checkbox label={<FormattedMessage defaultMessage="dummy" />} />
When used this way, the label DOM node will be completely replaced by the supplied component (in this case a span) and the checkbox will not be usable.
React:
<Checkbox label={<span>test</span>} />
DOM:
<div class="ui checkbox">
<input type="checkbox" class="hidden" readonly="" tabindex="0" value="on">
<label><span>test</span></label>
</div>
React:
<Checkbox label={<span>test</span>} />
DOM:
<div class="ui checkbox">
<input type="checkbox" class="hidden" readonly="" tabindex="0" value="on">
<span>test</span>
</div>
0.81.1
Ir's an expected result, you need to use:
Checkbox label={{ children: <span>test</span>}} />
<div class="ui checkbox">
<input type="checkbox" class="hidden" readonly="" tabindex="0" />
<label><span>test</span></label>
</div>
Most helpful comment
Ir's an expected result, you need to use: