I\'m using Typescript with React for a project. The Main component gets passed state with this interface.
interface MainState { todos: Todo[]; hungry: B
Edit: DO NOT USE this solution, prefer https://stackoverflow.com/a/41828633/1420794 See comments for details.
Now that spread operator has shipped in TS, my preferred solution is
this.setState({...this.state, editorState}); // do not use !