TLDR: Use defaultChecked instead of checked, working jsbin.
Trying to setup a simple checkbox that will cross out its label text when it is checked. For some reason
If you have a handleChange function that looks like this:
handleChange = (e) => {
this.setState({
[e.target.name]: e.target.value,
});
}
You can create a custom onChange function so that it acts like an text input would:
{
this.handleChange({
target: {
name: e.target.name,
value: e.target.checked,
},
});
}}
/>