I'm facing an issue with a generic type that defaults to string
:
interface EntityState<typeOfID = string> {
entities: { [ id: typeOfID]: any };
}
The error I receive is:
An index signature parameter type must be either 'string' or 'number'.(1023)
I have attempted the following solution as well:
interface EntityState<typeOfID extends string | number> {
entities: { [ id: typeOfID]: any };
}
However, this approach has not resolved the issue. What steps can I take to fix it?