I\'m using Typescript with React for a project. The Main component gets passed state with this interface.
interface MainState { todos: Todo[]; hungry: B
I think that the best way to do it is to use Partial
Partial
Declare your component in the following way
class Main extends React.Component> { }
Partial automatically changes all of the keys to optional.