Hello, I have this issue with tsx. I’m not sure how to compose the type for generics.
In my Options component I have an interface that gets display
(display is property name of T, value will be passed as string) that should be a key in T. T will hold an array of PETS or USERS. The extends {id: string}
here is to ensure that the PETS or USERS has an ID property.
These links are my reference.
https://www.typescriptlang.org/docs/handbook/advanced-types.html#index-types
https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase/#generic-components
Thank you for the help.