Answers for "updating nested attributes js"

0

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 });
}
Posted by: Guest on July-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language