I've got this method:
updateDate(row: TaskItem, column: keyof TaskItem, date: string) {
row[column] = date;
}
Where TaskItem looks like this:
export interface TaskItem {
id: number,
myDate: string
}
And I want to be able to call it like this:
updateDate(rowItem, 'myDate', '2022-02-20');
However, TS doesn't like it:
Type 'string' is not assignable to type 'never'.ts(2322)
It works as soon as I change row: TaskItem to row: any, but I'd like to be more concise.