I am trying to set multiple state properties at same time, but since setState() is asynchronous I've to use callback, but as more properties I have to edit at one time this code becomes more & more ugly!
Is there any other good way to achieve this?
this.setState(
{
item_1: true
},
(e => {
this.setState(
{
item_2: false
},
(e => {
this.setState(
{
item_3: 'Hello World'
}
)
})
)
})
)