I'm trying to right a ternary operator for my sx in MUI.
Any idea why this isn't working?
sx={{...calendarDayColor, isSameDay(new Date(props.date), new Date(selectedDay)) ?bgcolor:'secondary.main'}}
I'm trying to right a ternary operator for my sx in MUI.
Any idea why this isn't working?
sx={{...calendarDayColor, isSameDay(new Date(props.date), new Date(selectedDay)) ?bgcolor:'secondary.main'}}
try this:
sx={{
...calendarDayColor,
bgcolor: isSameDay(new Date(props.date), new Date(selectedDay))
? bgcolor
: 'secondary.main',
}}