Store item = undefined, causes typescript error
throws:
How to deal with this? I wish to avoid having
undefined as a type: items: { [key: string]: Item | undefined }undefineditems: { [key: string]: Item | undefined }items[item.id] = undefinedType 'undefined' is not assignable to type '{ ...<item props> }'.ts(2322)