I am trying to find the best way to remove an element from an array in the state of a component. Since I should not modify the this.state variable directly, is
this.state
You could make the code more readable with a one line helper function:
const removeElement = (arr, i) => [...arr.slice(0, i), ...arr.slice(i+1)];
then use it like so:
this.setState(state => ({ places: removeElement(state.places, index) }));