Transform withTiming
from Reanimated 3
#1825
Unanswered
andrei-zgirvaci
asked this question in
Q&A
Replies: 3 comments 6 replies
-
There is a known issue where the transform props in Skia is not animatable
by Reanimated 3.
As a workaround, until we fix the issue, we found that animating on the
matrix property instead works as expected.
…On Fri, Sep 8, 2023 at 10:16 AM Andrei Zgîrvaci ***@***.***> wrote:
Hi everyone,
I am trying to make the transform scale value animate withTiming from
Reanimated 3, but it doesn't seem to work, but, I found a way to make it
work with useTiming from Skia instead.
However, the animations don't look smooth even if the FPS is 60 on both
the JS and UI threads. It definitely looked smoother when doing this purely
with Reanimated 3 and just Animated Views.
I am sure I am doing something wrong, but not sure what... I would really
appreciate it if someone could point me in the right direction!
P.S. Could it be because I am rendering multiple child in the Group
component?
export default function Home() {
const scale = useDerivedValue(() => {
const scale = interpolate(
value,
[0, 100],
[1, 2],
{
extrapolateRight: 'clamp',
},
);
return scale;
});
const transformScale = useTiming(scale.value, {
duration: 500,
easing: Easing.inOut(Easing.quad),
});
const transform = useComputedValue(
() => [{ scale: transformScale.current }],
[transformScale],
);
return (
<Canvas>
<Group
origin={{
x: canvasSize.width / 2,
y: canvasSize.height / 2,
}}
transform={transform}
>
<Circle
cx={canvasSize.width / 2}
cy={canvasSize.height / 2}
r={MIN_INDICATOR_SIZE}
/>
<Circle
cx={canvasSize.width / 2}
cy={canvasSize.height / 2}
r={MIN_INDICATOR_SIZE * 0.85}
/>
<Circle
cx={canvasSize.width / 2}
cy={canvasSize.height / 2}
r={MIN_INDICATOR_SIZE * 0.65}
/>
<Circle
cx={canvasSize.width / 2}
cy={canvasSize.height / 2}
r={MIN_INDICATOR_SIZE * 0.45}
/>
</Group>
</Canvas>
);
—
Reply to this email directly, view it on GitHub
<#1825>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKXVRU5E6AWE5DXZBPMW3XZLH5ZANCNFSM6AAAAAA4QAOZLE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
6 replies
-
Oh, please note this is the
Good luck @andrei-zgirvaci! |
Beta Was this translation helpful? Give feedback.
0 replies
-
The Reanimated 3 integration has been fixed in 3.5.3 and above. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I am trying to make the transform scale value animate
withTiming
from Reanimated 3, but it doesn't seem to work, but, I found a way to make it work withuseTiming
from Skia instead.However, the animations don't look smooth even if the FPS is 60 on both the JS and UI threads. It definitely looked smoother when doing this purely with Reanimated 3 and just Animated Views.
I am sure I am doing something wrong, but not sure what... I would really appreciate it if someone could point me in the right direction!
P.S. Could it be because I am rendering multiple child in the
Group
component?Beta Was this translation helpful? Give feedback.
All reactions