akiran / react-slick

React carousel component
http://react-slick.neostack.com/
MIT License
11.72k stars 2.1k forks source link

Not able to destroy slick-slider and re render it #761

Closed rohitgoyal7 closed 7 years ago

rohitgoyal7 commented 7 years ago

Guidlines for posting new issue

rohitgoyal7 commented 7 years ago

I am using slick slider for dynamic images where user can add or delete images at run time, but its not working well.

fdc-viktor-luft commented 7 years ago

React Basics: simply supply a new key to the Slider... Does this solve your Problem?

brovkin commented 3 years ago

React Basics: simply supply a new key to the Slider... Does this solve your Problem?

It's working! Thx @fdc-viktor-luft

f3tusz commented 1 year ago

Hi @brovkin Can you provide code for this solution?

hungdev commented 1 year ago

i get same issue

brovkin commented 1 year ago

@f3tusz Hi! I don't remember exactly (it was 2 years ago), but I just added key="{unique value}" to the slider and it worked, try it like that:

<Slider key="slider_2">
    ...
</Slider>.
hungdev commented 1 year ago

@brovkin thank you for your comment. I tried that solution yesterday, but it didn't work. Then now I changed to https://swiperjs.com/react