I'm trying to combine two arrays into one using the spread object like below:
const queryVariable = {
...this.state,
filters: [...Object.keys(extraFilters || {}), ...this.state.filters],
}
this.state.filters is an array here. But typescript gives me the following error:
Type must have a '[Symbol.iterator]()' method that returns an iterator.
What am I doing wrong here?