I\'m using Typescript with React for a project. The Main component gets passed state with this interface.
interface MainState { todos: Todo[]; hungry: B
Update state explicitly, example with the counter
this.setState((current) => ({ ...current, counter: current.counter + 1 }))