You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to define layout animations with shared values and write animation functions in the following style.
constentering=(values: EntryAnimationsValues): LayoutAnimation=>{'worklet';t.value=withTiming(1,{duration: 300});// ignore where `t` comes from for nowreturn{animations: {originX: interpolate(t.value,[0,1],[0,values.targetOriginX]),originY: interpolate(t.value,[0,1],[0,values.targetOriginY]),},initialValues: {originX: 0,originY: 0,},};};
I know that the same behavior can be done without using t like,
I think that when the animation gets more complicated, the style of the former will describe it better and sometimes it's even impossible to write in the style of the latter.
However, I found that the former just didn't work! And the properties in animations didn't behave like the ordinary animated style properties. We can't use derived values for it, like
and I found that makeMutable is not callable inside a worklet. Do we have other options other than calling useSharedValue multiple times to use entering multiple times?
I'm worried that I totally misunderstood the concept of entry/exit animation functions. I would be really grateful if someone give a nice explanation of it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to define layout animations with shared values and write animation functions in the following style.
I know that the same behavior can be done without using
t
like,I think that when the animation gets more complicated, the style of the former will describe it better and sometimes it's even impossible to write in the style of the latter.
However, I found that the former just didn't work! And the properties in
animations
didn't behave like the ordinary animated style properties. We can't use derived values for it, likeThe addition of 100 and the usage of
interpolate
makes is not work. Only simple animation values likewithTiming(...)
work as I observed.Also, there's another problem with defining the shared value
t
. I triedmakeMutable
inside the worklet like,and I found that
makeMutable
is not callable inside a worklet. Do we have other options other than callinguseSharedValue
multiple times to useentering
multiple times?I'm worried that I totally misunderstood the concept of entry/exit animation functions. I would be really grateful if someone give a nice explanation of it.
Beta Was this translation helpful? Give feedback.
All reactions