Answers for "An index signature parameter type cannot be a literal type or generic type."

C
0

An index signature parameter type cannot be a literal type or generic type.

enum Options {
  ONE = 'one',
  TWO = 'two',
  THREE = 'three',
}
interface OptionRequirement {
  someBool: boolean;
  someString: string;
}
type OptionRequirements = {
  [key in Options]: OptionRequirement; // Note that "key in".
}
Posted by: Guest on September-21-2021

Code answers related to "An index signature parameter type cannot be a literal type or generic type."

Code answers related to "C"

Browse Popular Code Answers by Language