react-native-image-slider-box
react-native-image-slider-box copied to clipboard
Remove dynamically images
Hi
As seen on title i would like to remove dynamically images from slide, when i choose one image and remove it all images gone, i used index variable and put it in state to get current index, and just slice the item in array:
setState({ images: this.state.images.splice(i, 1) })
Hi
As seen on title i would like to remove dynamically images from slide, when i choose one image and remove it all images gone, i used index variable and put it in state to get current index, and just slice the item in array:
setState({ images: this.state.images.splice(i, 1) })
Try setState({ images: this.state.images.filter((_, idx) => idx !== i })