I am trying to update a react state with these two objects where one is an array and another is object
DumpNames = [], {ActiveTab: '0'}
So if I put array object in setState as
this.setState({DumpNames})
Then it will create key-value pair with DumpNames : [].
How do I combine ActiveTab object along with DumpNames.
i.e. I want to do something like
this.setState({DumpNames,{ActiveTab}})
However If I try to put both these objects in an array and then destruct then it works fine.
let myObjects = [{DumpNames : DumpNames, ActiveTab : ActiveTab}]
this.setState(...myObjects)
Is there any other way I can accomplish this rather than destructing this way ?