Skip to content

TS2488: Type '{}' must have a '[Symbol.iterator]()' method that returns an iterator #1091

Answered by phoenisx
phoenisx asked this question in Support
Discussion options

You must be logged in to vote

I solved this (temporarily) by forcefully passing deps parameters.

  const [, setScrollPos, stopScroll] = useSpring(() => {
    if (isBrowser()) {
      return {
        immediate: false,
        from: { y: window.pageYOffset },
        onChange: (y: number) => {},
        onRest: () => {},
        config: config.slow,
      };
    } else {
      return {
        from: { y: 0 },
      };
    }
  }, []);

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@phoenisx
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by phoenisx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants