I would like to create a switch between tabs based on a boolean array. However, I do not know how to replace the switchTabs function to stop this error from being displayed. The interface is built like this:
interface IData {
setData: boolean[];
}
My constructor looks like this:
constructor(props: IData) {
super(props);
this.state = {
setData: [true, false, false]
}
}
However, the method in which the error (Type 'boolean' is not assignable to type 'boolean[]') occurs looks like this:
private switchTabs() {
this.setState({ setData: !this.state.setData});
}