redux update class members in redux reducer code example
Example: updating nested attributes js
onChange(e) {
const { user } = { ...this.state };
const currentState = user;
const { name, value } = e.target;
currentState[name] = value;
this.setState({ user: currentState });
}