Animating a spring configuration #1222
Answered by aleclarson
mattrossman asked this question in Support
-
| Is it possible to animate the configuration itself for a spring? For instance, have a spring that smoothly transitions between a loose and tight configuration (without re-renders)? |
Beta Was this translation helpful? Give feedback.
Answered by aleclarson Dec 6, 2020
Replies: 1 comment 2 replies
-
| In v9, something like this should work: const { tension } = useSpring({ from: { tension: 100 }, to: { tension: 200 }, loop: { reverse: true }, onChange({ tension }) { x.animation.config.tension = tension } }) const { x } = useSpring({ ... }) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by mattrossman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
In v9, something like this should work: