fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Question - How to retrieve checkbox label ?

Open OverkillTV opened this issue 9 years ago • 2 comments

Hi all, This is not an issue. It's just a small question since I couldn't find where to post this. If I have a Checkbox like this: <Checkbox defaultChecked={false} label={"ABC check"} onChange={ this._onCheckboxChange } />

How do I get the checkbox label inside the _onCheckboxChange method ?

Thanks,

OverkillTV avatar Oct 05 '17 09:10 OverkillTV

Checkbox has the prop onRenderLabel where you can use a custom render function for the label, which means you can set a ref for the label, connect it to state, etc

erichdev avatar Oct 06 '17 01:10 erichdev

Thanks @erichdev ! I'll try it out.

OverkillTV avatar Oct 06 '17 06:10 OverkillTV