Check out example codes for "No index signature with a parameter of type 'string' was found on type". It will help you in understanding the concepts better.

Code Example 1

//YOU HAVE TO SPECIFY THE TYPE OF THE KEY WHEN YOU WANT TO USE THE OBJECT
// BRACKET SELECTION
// ONE WAY TO DO IT:

interface CustomType {
  [key: string]: any;
  
  key1: string;
  key2: number;
  //...
}

Learn ReactJs, React Native from akashmittal.com