How do I run a set function in v9? #1383
-
I'm experiencing a quite drastic bug after updating from the v9 RC candidate to the current 9.0.0 release, and I think it is related to this issue: I think this question is related to the problems in this issue: #1359 Unfortunately I cannot post the exact code, but I will attempt to recreate it here. Before, I would pass a function with an object to
Now, this workflow is all broken. The second argument in the destructured array is a ref, not a set function, which is not what the documentation says. Also, I see there is a new dependency array syntax introduced in V9, where you put the array of dependencies in the
And also, was confused from the v9 documentation: why do I still even need to do
I'm very confused and would appreciate any help. Thank you so much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Would this work? const [ spring, api ] = useSpring(() => config)
useEffect(() => {
api.current[0].set(config)
}, [someDependency]) It's quite hard to debug without an example. Tbh I'm not super familiar with using deps in the spring. |
Beta Was this translation helpful? Give feedback.
Would this work?
It's quite hard to debug without an example. Tbh I'm not super familiar with using deps in the spring.