score:0

Accepted answer
bmiCalc() {
    const bmi = this.state.weight/(this.state.height*this.state.height)*10000;
    let judge = 'Obesity';
    if(this.state.bmi<18.5){this.setState({judge: 'Underweight'});}
    else if(this.state.bmi<24.9){this.setState({judge:'Normal weight'});}
    else if(this.state.bmi<30){this.setState({judge:'Overweight'});}

    this.setState({bmi: bmi, judge: judge});
}

score:1

function desiredActions (){
  action1()
  action2()
}

<button onclick={desiredActions}></button>

Related Query

More Query from same tag