How can I add a custom attribute and get its value within onCheck handler?
Example:
<Checkbox
label={this.props.label}
onCheck={this.onCheck}
checked={this.props.checked}
labelStyle={{width: 'initial'}}
data-my-custom-attribute="FOO" // the attribute
/>
onCheck(e, checked) {
// How to get the attribute here?
let foo = e.target.getAttribute('data-my-custom-attribute'); // foo === "FOO"
}
This has to be the worst handling of an issue ever. Gotta remember this guy cause I don't want him on my team.