akiran / akiran/react-slick

asNavFor does not work if slider renders conditionally

Đang mở
#1,775 2 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ả

When you have some async routes or simply conditional rendering of the Gallery (slider) `asNavFor` attribute does not sync both sliders unless you trigger a redundant force update of the component.

Codesandbox that reproduces the issue: https://codesandbox.io/s/react-slick-playground-0q390?file=/index.js

Scenario:
* First click the `show` button, both sliders appears on the page but when you navigate between them they don't appear to be synced.
* Click `rerender` button
* Try navigating between sliders once again. They should be working in sync.

Expected behavior:
Both sliders should be synced right after the initial render.
**OR**
You should mention in the documentation that you need to force the render of another component when you're using `asNavFor` property on your slider.

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.