Problems with animation using images in Next.js
- 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ả
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?
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.