I'm a beginner in react, and I'm following a tutorial for display objects returned by a REST api.
In handleChangeTitle
method I get the value written in text box, and I update the state of component with new activeItem:
handleChangeTitle(e){
//ogni volta che cambia qualcosa nella casella di testo, viene chiamata questa funzione
var name = e.target.name
var value = e.target.value
console.log('Name:', name)
console.log('Value:', value)
this.setState({
activeItem:{
...this.state.activeItem,
title:value
}
})
}
What are the ellipsis for before referring to this.state.activeItem
?