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'm trying to achieve 'automatic' animated layout transitions-- specifically, animate the resizing of a view when it's content changes. Although I'm already using Moti in the app, I've continued to rely on React Native's LayoutAnimation for this, called through useLayoutEffect() when the content state changes.
I may be missing it, but I couldn't find an example or documentation for this use case. I thought perhaps this is handled by the MotiViewtransition property, but didn't have luck with my experiments. Looking into Reanimated, it appears to achieve this effect through the Animated.Viewlayout property, so I tried to apply one of their examples to a MotiView:
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
-
I'm trying to achieve 'automatic' animated layout transitions-- specifically, animate the resizing of a view when it's content changes. Although I'm already using Moti in the app, I've continued to rely on React Native's
LayoutAnimation
for this, called throughuseLayoutEffect()
when the content state changes.I may be missing it, but I couldn't find an example or documentation for this use case. I thought perhaps this is handled by the
MotiView
transition
property, but didn't have luck with my experiments. Looking into Reanimated, it appears to achieve this effect through theAnimated.View
layout
property, so I tried to apply one of their examples to aMotiView
:This didn't work either. Could be I'm just doing something wrong.
So what is the preferred Moti way of achieving this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions