I am trying to implement nested if else in react compound slider. I am able to write if else using ternary operator and that is working fine
<div className={source.value >.3 ? 'greater': 'lesser'}>
<Track
key={id}
source={source}
target={target}
getTrackProps={getTrackProps}
/>
</div>
so here i am able to check only condition whether it is greater than .3 or less than but am trying to implement
if(source.value <.3)
{
return classNameFirst
}
else if (source.value >.3 && source.value <.7){
return classnameSecond
}
else if (source.value >.7 && source.value <.9){
return classnamethird
}
else if (source.value >.9 && source.value <1.2){
return classnameFourth
}
else{
return classnamefive
}
how can i implement this thing into my jsx code.
Thanks in advance.
<div className={getTrackClassName(source)}>or something similar