Migrate interpolate() to to() in v9 #1214
Answered
by
aleclarson
RomainCscn
asked this question in
Support
-
Hello! I'm new to react-spring, and used v8 to accomplish a simple scale animation. Here's the component, where const Component = () => {
const { x } = useSpring({ from: { x: 0 }, x: 1 });
return (
<Text
style={{
opacity: x.interpolate({ range: [0, 1], output: [0, 1] }),
transform: x
.interpolate({
range: [0, 0.2, 0.5, 1],
output: [1, 0.7, 1.5, 1],
})
.interpolate((x: number) => `scale(${x}) rotate(4deg)`),
}}
>
My text
</Text>
);
}; I couldn't find any example using this syntax, if you could help on this, thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
aleclarson
Nov 28, 2020
Replies: 1 comment 4 replies
-
Same interface, but named |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
RomainCscn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same interface, but named
.to()
instead of.interpolate()