I am getting the following error and I cannot work out why its complaining..
Error TS2322 (TS) Type '() => string' is not assignable to type 'string'.
Closest I came to finding info about this error was here but while the error was the same the situation was not.
I am equating "cssClasses", which is defined as a string, to an anonymous function that returns a string.. That's the idea and the function returns a string yet its saying "string is not assignable to string"
How do I fix this?
This is my code:
for (let day = 0; day < numberOfDays; day++) {
cssClasses = (): string => {
if (day == calendarLayout.dayDifference) {
return "cal-heading2-day-" + day.toString() + " " + cssToday;
} else
return ("cal-heading2-date-" + day.toString())
}...