My server query can receive two types of responses:
interface Response {
[id: string]: Data
}
or
interface Response {
error: string
}
However, I am encountering an error message that says:
Property 'error' of type 'string' is not assignable to string index type '{ /* Structure of Data */ }'.
What would be the correct way to type this object?