akiran / akiran/react-slick

Problems with animation using images in Next.js

Offen
#2,180 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
11.9k
Forks
2.1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.