updating nested attributes js

Solutions on MaxInterview for updating nested attributes js by the best coders in the world

showing results for - "updating nested attributes js"
Curtis
03 Sep 2019
1onChange(e) { 
2  const { user } = { ...this.state };
3  const currentState = user;
4  const { name, value } = e.target;
5  currentState[name] = value;
6
7  this.setState({ user: currentState });
8}
9