using update function gives error #992
-
|
const [props, set] = useSpring({ x: 0, y: 0 }) this gives a type-error: TypeError: Invalid attempt to destructure non-iterable instance |
Beta Was this translation helpful? Give feedback.
Answered by
aleclarson
May 9, 2020
Replies: 1 comment
-
|
To get an array back from useSpring(() => ({ x: 0, y: 0 })
// or
useSpring({ x: 0, y: 0 }, []) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
aleclarson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

To get an array back from
useSpring, you need to pass a props function or a dependency array.