Skip to content

Animating a spring configuration #1222

Answered by aleclarson
mattrossman asked this question in Support
Discussion options

You must be logged in to vote

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({ ... })

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mattrossman
Comment options

@aleclarson
Comment options

Answer selected by mattrossman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants