question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get Layout Animations to work on a simple View

See original GitHub issue

Description

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

Affected platforms

  • Android
  • iOS
  • Web

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kkafarcommented, Jan 28, 2022

Sometimes it this way! 😄 Glad to hear its working for you. Closing.

0reactions
ernestasgobioniscommented, Jan 28, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found