How can I set a received props into a state without necessity of specify the state names and props names

editRow (props) {
   this.state.id = props.row.id
   this.state.name = props.row.name
}

This will fill my state, but i want to fill the state without specify the names

Something like that

editRow (props) {
  this.state = { ...props }
},
1 Like