akiran / akiran/react-slick

asNavFor does not work if slider renders conditionally

Abierto
#1,775 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
11.9k
Forks
2.1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.