https://codesandbox.io/s/otherusersmap-typescript-problem-gpkbhf?file=/src/index.ts
So my Redux reducer uses a bunch of TypeScript records to make fetching information faster. So, I created a general function for mapping an object with its id. However, I have this object that breaks the usual convention of the object being stored extending {id:number}. In this case, it's [string, Type extending {id:number}].
The function is generateStateMapFromArr, as you can see in the sandbox. For some reason TypeScript is saying that the returned object is just {id: number}, when it should be [string, Type<extends {id:number}]. It however works for the case when Type<extends {id:number}> is the input.
I figure the problem is with generateStateMapFromArr input type, but I don't know what exactly is the issue.
Also it's my first time using CodeSandbox.io, so let me know if there's an issue.