Accepted answer

you can use inline styling where this.state.score will be your value for left property:

style={{ left: `${this.state.score}%` }}

you can use back-ticks to concatenate % string with score value at the end:

      ? 'results-container'
      : 'results-container-closed'
  <div classname="result-wrapper">
    {this.state.score === ''
      ? 'click record and check your score'
      : 'your score: ' + this.state.score}

<div classname="scale-container">
  <div classname="bar">
    <div classname="arrow-up" style={{ left: `${this.state.score}%` }}></div>
    <div classname="scale-meter"></div>

Related Query

More Query from same tag