let index = array.indexOf(e.target.value) if (index !== -1) { array.splice(index, 1); setState(array); }