Css – Changing MUI Switch component colors
I'm using switch component from MUI, I want to toggle the styling between two colors <Switch color={dataType === "expenses" ? "error" : "secondary"} onChange={handleOnSwitch} checked={dataType === "expenses"} /> The problem is the color is applied only when the condition is…