Replies: 2 comments 19 replies
-
Hey @mhoran! If you want to create one-shot layout transitions, you can use your approach with |
Beta Was this translation helpful? Give feedback.
-
If you still feel that we should provide an easier way to disable or enable a layout transition, please describe your use case more in detail and we may reconsider adding something in the future. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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