akiran / akiran/react-slick

asNavFor does not work if slider renders conditionally

Ouverte
#1,775 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
11.9k
Forks
2.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.