fluentui
fluentui copied to clipboard
Question - How to retrieve checkbox label ?
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,
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
Thanks @erichdev ! I'll try it out.