Answers for "how use object in setstate"

0

how use object in setstate

this.state = {
   jasper: { name: 'jasper', age: 28 },
}

this.setState({
    jasper: {
          ...this.state.jasper,
          name: 'something'
    }
})
Posted by: Guest on June-16-2021

Code answers related to "how use object in setstate"

Browse Popular Code Answers by Language