Skip to content

Interpolation usage docs #1637

Answered by joshuaellis
xndyz asked this question in Support
Jul 18, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

It's definitely documented in the docs under interpolation. It's simply renamed to to so your code would be come:

<animated.div
  style={{
    opacity: styles.opacity,
    transform: styles.y.to((y) => `translateY(${y}px)`),
  }}
>

But you don't actually need to do that interpolation is v9 of react-spring you could simply pass the y prop to the styles object 👍🏼

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@xndyz
Comment options

@joshuaellis
Comment options

@xndyz
Comment options

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

This discussion was converted from issue #1636 on July 19, 2021 07:08.