applied_filters: { title: [''], owner: [''], customer: [''] }
One of the states that I have looked like above. I tried to use setState to add value to one of the keys by doing
this.setState({
applied_filters: [
...this.state.applied_filters,
{title: [...this.state.applied_filters.title, optionItem.option]}
]
})
This gives me an error this.state.applied_filters is not iterable
What am I doing wrongly?