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
Similar to #2513, I'm looking for an easier way to selectively disable layout transitions. For example, I'd like to animate the layout change of an input box when a button appears in the same row. I achieved this easily with React Native LayoutAnimation.configureNext previously. In moving to Reanimated, I've been able to recreate this behavior by reacting to the state change and swapping out the configured layout between LinearTransition and undefined. I've also added a withCallback to the animation which disables the animation once it has fired, effectively making it one-shot.
I could see extending LayoutAnimationConfig with a skipTransition argument. That takes care of half of the problem. Regarding one-shot animations, I have added a single withCallback to one of the animations that will fire, which sets the layout to undefined. I wonder if this should be pulled up higher, e.g. to the LayoutAnimationConfig or similar, to help with readability/discoverability.
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
-
Similar to #2513, I'm looking for an easier way to selectively disable layout transitions. For example, I'd like to animate the layout change of an input box when a button appears in the same row. I achieved this easily with React Native
LayoutAnimation.configureNext
previously. In moving to Reanimated, I've been able to recreate this behavior by reacting to the state change and swapping out the configuredlayout
betweenLinearTransition
andundefined
. I've also added awithCallback
to the animation which disables the animation once it has fired, effectively making it one-shot.I could see extending
LayoutAnimationConfig
with askipTransition
argument. That takes care of half of the problem. Regarding one-shot animations, I have added a singlewithCallback
to one of the animations that will fire, which sets thelayout
toundefined
. I wonder if this should be pulled up higher, e.g. to theLayoutAnimationConfig
or similar, to help with readability/discoverability.Beta Was this translation helpful? Give feedback.
All reactions