score:2

Accepted answer
 deleteHandler: function(e,index){
      //copy array
      var newAray = this.state.listdata.slice();
      //delete element by index
      newAray.splice(index, 1);
      this.setState({listdata: newAray});
  },
 <button onClick={e=>this.deleteHandler(e,index)}>delete</button>

score:1

<button onClick={()=>this.deleteHandler(index)}>delete</button>

score:2

  deleteHandler: function(index){
    this.setState(state => {
      // state.listdata - array of initial values,
      state.listdata.splice(index, 1);
      return {listdata: state.listdata}; // returns a new state
    });
  }

Related Query

More Query from same tag