react-native-image-slider-box icon indicating copy to clipboard operation
react-native-image-slider-box copied to clipboard

Remove dynamically images

Open mldmix opened this issue 5 years ago • 1 comments

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) })

mldmix avatar Jun 04 '20 09:06 mldmix

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 })

bambomax avatar Jun 23 '20 08:06 bambomax