Answers for "Object literal may only specify known properties, and 'key' does not exist in type 'SetStateAction<DetailsDict>'."

0

Object literal may only specify known properties, and 'key' does not exist in type 'SetStateAction<DetailsDict>'.

type Employee = {
  id: number;
  [key: string]: string | number | number[]; //try this part to indicate return type
  years: number[];
};

const emp: Employee = {
  id: 1,
  name: 'Alice',
  department: 'accounting',
  salary: 100,
  years: [2022, 2023],
};
Posted by: Guest on March-09-2022

Code answers related to "Object literal may only specify known properties, and 'key' does not exist in type 'SetStateAction<DetailsDict>'."

Browse Popular Code Answers by Language