akiran / akiran/react-slick

Change settings dynamically

Đang mở
#1,634 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
11.9k
Fork
2.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I am using React-Slick for my project and I want to be able to dynamically change the settings that I provide to my slider.

For slickjs (https://github.com/kenwheeler/slick) this can be done using `slickSetOption`.

I realized that it is not possible to use `slickSetOption` in React Slick after reading the documentation.
However, after reading the following it made me think that it *should* be possible to in fact change the settings of the slider in a dynamic way.

`slickGetOption` has been implemented
`slickSetOption` will not be implemented, those effects be achieved by passing props via state from the wrapper component

_Originally posted by @laveesingh in https://github.com/akiran/react-slick/issues/1063#issuecomment-368816567_

My implementation looks like this, and unless I am using this in a completely wrong way or have misunderstood the above statement this is probably a bug.


{images}

Using React Slick's playground I've put together this to demonstrate the issue:
https://codesandbox.io/s/react-slick-playground-unyot

Sort of a dodgy work around is to add a `key` prop to `` and change the value of that as the props changes.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.