score:1

Accepted answer

you may want to use tostring() for your input value rather than storing string in state. try this demo

render() {
return (
  <div>
    <div>
      <input
        step="1"
        type="number" 
        name="code1"
        value={this.state.code1.tostring()} 
        onchange={this.handlechange} 
        min="0" 
        max="100" 
      />
    </div>
    <div>
      <input 
        type="number" 
        name="code2"
        value={this.state.code2.tostring()} 
        onchange={this.handlechange} 
        min="0" 
        max="100" 
      />
    </div>
    <div>
      <input 
        type="number" 
        name="code3"
        value={this.state.code3.tostring()} 
        onchange={this.handlechange} 
        min="0" 
        max="100" 
      />
    </div>
    <button onclick={this.handlereset}>reset</button>
  </div>
)
}

Related Query

More Query from same tag