Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with animation using images in Next.js #2180

Open
edwinpgm opened this issue Sep 12, 2022 · 0 comments
Open

Problems with animation using images in Next.js #2180

edwinpgm opened this issue Sep 12, 2022 · 0 comments

Comments

@edwinpgm
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant