I am utilizing React-Bootstrap for a simple text box component. Right now, the callback is called every time the user edits the textbox, hence it is called back when every letter is called
<Form.Group controlId="Id">
<Form.Label>Id</Form.Label>
<Form.Control style = {{marginLeft: 10}} name="Idstate" onChange={this.handleChange} defaultValue = {this.state.idstate}/>
</Form.Group>
The code above is my form group
handleChange = (event) => {
event.persist()
const name = event.target.name
if (name == "Idstate"){
this.setState({idstate: event.target.value})
this.state.idstate = event.target.value;
Apiservice.updatetabletopmenudata(this.tableid, event.target.value, "idstate")
}
console.log(this.state)
}
This results in a really laggy process, and sometimes the data isn't saved properly
Is there any way for the callback to be executed only after the user has finished editing the text box?