react-icheck
react-icheck copied to clipboard
Documentation of onChange handling
When passing onChange to the checkox component I expected to be able to read e.target.checked which doesnt work, since it triggers before rerendering the inner checkbox. I found that you explicitely pass the 'checked' argument to the given onChange function. This is good, but i needed to search through your code to find out about this, and i think that this is non-default behaviour.
I would suggest adding this to the documentation.
@cdxOo :+1:
For anyone wondering how to do this:
handleCheck(e, checked) {
console.log(e.target.value); //outputs the value of the checkbox
console.log(checked); //outputs true or false
}
<Checkbox onChange = {this.handleCheck} value="Apple" label="Apple"/>