Can't get Layout Animations to work on a simple View
See original GitHub issueDescription
Not sure if it’s a bug in the library, or if I’m missing something in the setup, but I can’t get Layout Animations to work in any way, none of the stages seem to be working (entering, exiting, layout). I have a simple view that I’m trying to animate when toggling a state variable, but it just appears without any animations at all.
Expected behavior
Expected the view to fade in and out when mounting/unmounting.
Actual behavior & steps to reproduce
No animations are working in either stage.
Snack or minimal code example
{showView && <Animated.View
style={[styles.ball, animatedStyles]}
entering={FadeIn.duration(2000).springify().mass(0.3)}
exiting={FadeOut.duration(2000).springify().mass(0.3)}
/>}
Package versions
- React Native: 0.66.0
- React Native Reanimated: 2.3.1 / https://github.com/software-mansion/react-native-reanimated#main (tried with both)
- NodeJS: 16.1.0
- Xcode: 13.2.1
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Layout animation not working on first run - Stack Overflow
If you attempt to animate on a view that has not been rendered yet, the animation will occur on the view without a...
Read more >Auto animate layout updates - Android Developers
All you need to do is set an attribute in the layout to tell the Android system to animate these layout changes, and...
Read more >Layout Animations - React Native Reanimated - YouTube
Your browser can't play this video. ... 37K views 1 year ago ... Layout Animations are here to address the problem and help...
Read more >The magic of Layout Animations in Reanimated (React Native)
In this tutorial we'll learn how to handle the new feature of Reanimated 2: Layout Animations. In order to do it we're going...
Read more >Add animation to slides - Microsoft Support
Training: Add animation and effects to text, pictures, shapes, and objects in your PowerPoint presentation. Watch this video to learn how.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sometimes it this way! 😄 Glad to hear its working for you. Closing.
Hi @kkafar,
I think I have checked the Example app before and everything was working fine there, and as far as I remember I basically copied one of the examples and it didn’t work.
But now I tried to reproduce it, and it seems to work now (magic 😀). Unless I was doing something different when submitting this issue, but I think it was an even simpler case that I used to reproduce it now.