-2
I would like to save with the data that is already selected but does not work, I have to put in yes and then go back to no
Method
handleChange(e) {
let obj=Object.assign({},this.state.area)
obj[e.target.name]=e.target.value
this.setState({area: obj})
console.log(obj)
}
<div className="icalcar">
<select
className="combobox"
name="calcario"
value={this.state.area.calcario}
onChange={this.handleChange}>
<option name="calcario" value="Não">Não</option>
<option name="calcario" value="Sim">Sim</option>
</select>
</div>
if you have the complete component? and what are you trying to do? I don’t understand very well
– novic
It would not be because you are running logic in the method
handleChange
and must, obligatorily, that the value has changed to be executed? It seems to me to use the correct structure.– Woss