I have a situation where i need to add a class to a div element based on multiple conditions, here i have on level of nesting using ternary operator
<div className={
typeof this.state.weather.main !== "undefined"
? this.state.weather.main.temp > 16
? "app warm"
: "app cold"
: "app"
}
>
i would like to have something like,
if(this.state.weather.main.temp < 16){
//add "app cold" class
} else if(this.state.weather.main.temp > 16){
//add "app warm" class
} else if (this.state.weather.main.temp > 35){
//add "app hot" class
} else if(this.state.weather.main.temp > 50){
//add "app extreme" class
}
.....
and so on