I need to create a function to clear the table row data on specific state index. This quite new for me. I know how to do this in jquery, however I work on javascript library. no error but the data is not clearing if I start clicking the button.
Goal set the value empty
Current Output
Here is my Jsx code
<span className="fa fa-minus" onClick={this.ClearRowData} index={i}></span>
ClearRowData Function
ClearRowData = async (index) => {
const value = {
customer: "",
bank: "",
branch: "",
checkNo: "",
checkDate: "",
amount: "",
remarks: "",
}
const rows = [...this.state.rows]
var index = rows.indexOf(index)
if(index !== -1) {
this.setState({
...this.state.rows,
value
})
}
}
Thanks

