I have an array in state
state = {
array: [],
};
Later I do this
method = (el): void => {
const {array} = this.state;
const includesEl = array.includes(el);
}
And I'm getting an error
Argument of type 'any' is not assignable to parameter of type 'never'.
I type state interface like this
export interface State{
array: any[],
}
Should I type the state in state declaration as well? Because I assume the error is coming from the face that I'm setting array initially to []