akiran / react-slick

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

React slick list height issue when ading slick items dynamically #2015

Closed ghost closed 1 year ago

ghost commented 3 years ago

I am using the react-slick Slider Component to display a set of images. after the user crosses some slide position I am calling another API and appending the new results with the existing results using old.concat(new) stored in component state. Each time when the API is called, the slider displays 2 rows(its height is changed) and then adjust its height again. Once the API data is added to the array, is there is a glitch that disturbs the slider and then fixes after few seconds? or is it issue with my code? How do I fix this issue?

I created CodeSandBox to replicate the issue here: https://codesandbox.io/s/react-slick-playground-forked-ub5fy

bruno-sartori commented 3 years ago

Any updates on this?

sharmayash commented 2 years ago

@k-b-k-r Use afterChange method instead of beforeChange.