score:1

Accepted answer

it receives the props just fine.

the problem is with your switch statement. your case expressions result in true or false so that is what should be in the switch

switch (true) {
  case this.props.percentage > 75:
    type = "succes";
    break;
  case this.props.percentage > 50 && 75 >= this.props.percentage:
    type = "mediocre";
    break;
  case this.props.percentage <= 50:
    type = "failure123";
    break;
}

(also added = to the second and third cases so that there are no unhandled cases)


Related Query

More Query from same tag