Here is a method that I have:
updateDate(row: TaskItem, column: keyof TaskItem, date: string) {
row[column] = date;
}
The TaskItem interface is defined as follows:
export interface TaskItem {
id: number,
myDate: string
}
I would like to call the updateDate method like this:
updateDate(rowItem, 'myDate', '2022-02-20');
But TypeScript gives me an error:
Type 'string' is not assignable to type 'never'.ts(2322)
Changing row: TaskItem
to row: any
fixes the issue, but I prefer a more concise solution.