akiran / akiran/react-slick

Problems with animation using images in Next.js

Abierto
#2,180 0 comentarios 1 reacción 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

Hi all! I am working with library in a Next.js project using Image component from `next/image`, but I see that the animation break the first time that the library load the images.

I see that in the library exist this code to break the animation

```
resizeWindow = (setTrackStyle = true) => {
const isTrackMounted = Boolean(this.track && this.track.node);
// prevent warning: setting state on unmounted component (server side rendering)
if (!isTrackMounted) return;
let spec = {
listRef: this.list,
trackRef: this.track,
...this.props,
...this.state
};
this.updateState(spec, setTrackStyle, () => {
if (this.props.autoplay) this.autoPlay("update");
else this.pause("paused");
});
// animating state should be cleared while resizing, otherwise autoplay stops working
this.setState({
animating: false <----- HERE
});
clearTimeout(this.animationEndCallback);
delete this.animationEndCallback;
};
```
Are there some way to avoid this?

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.