react-slick
react-slick copied to clipboard
Removed Items
Hi, i have a problem when i want to delete one items Reproduce:
- Go to slide 2
- Click on the image
Live https://codesandbox.io/s/wnz6jxv267
hi!
You can try slickGoTo method. Pass index there to go to the previous slide (or whatever you want)
As well possibly you'll need to repaint (on the DOM level) your slides, try to use key prop for that.
uniqueId method from Lodash would help.
import uniqueId form 'Loadash';
<Slider {...settings}>
{this.state.items.map((el, index) => {
return (
<div
style={styles}
key={uniqueId()}
onClick={() => {
this.handleDelete(index);
}}
>
{el}
</div>
);
})}
</Slider>
@maxval94 the problems seems to be there in version 0.20.0. But when I checked with dev branch, it worked fine, that means it's already been fixed. You can try the same with the dev branch. These changes will be released soon.
Thanks