I\'m replacing an item in a react state array by using the ... spread syntax. This works:
let newImages = [...this.state.images] newImages[4] = updatedImage this
use Array.slice
this.setState({images: [...this.state.images.slice(0, 3), updatedImage, ...this.state.images.slice(4)]})