I've got a handleChange event that pushes data into the props
handleChange = input => e => {
let target = e.target,
type = target.type,
value = target.value;
this.setState({
[input]: (type === "checkbox" ? target.checked : value)
});
};
in the input, I handle the change onChange={onChange('services.cleaning')}
Is there anyway i can push the data in the props as a nested object instead of as "services.cleaning"?
The onchange event
<Checkbox onChange={onChange('services.cleaning')} type='checkbox' name='cleaning' />
onChangefunction?