TS7017

error TS7017: Element implicitly has an ‘any’ type because type ‘{}’ has no index signature.

Bad Code ❌

1
const recipients = {};

Fixed Code ✔️

1
const recipients: {[index: string]: number} = {};

How to fix such errors in interfaces:

1
2
3
export interface DexieInstance extends Dexie{
[index: string]: any;
}