software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.61k stars 1.26k forks source link

Flickering svgs when using Layout Animations on Android #4133

Closed roffelund closed 1 week ago

roffelund commented 1 year ago

Description

Referencing a really well described issue here with the same issue using reanimated. https://github.com/GeekyAnts/NativeBase/issues/5040

However we are not using NativeBase at all and getting the same issues with https://github.com/FormidableLabs/victory. Which leads me to suspect the issue is with layout animations in reanimated.

We have opacity on a graph from victory-native and every time we re-render the graph loses its styling and then it reapplies which causes a flicker. This only occurs using layout animations anywhere in the same component.

Note: We are not animating the graph. We have another component below that graph that animates.

Steps to reproduce

  1. First icon is native-base icon with usage of ‘as’ property, this icon has not semitransparent color, this will never flicker
  2. Second icon, is vector icon from ‘react-native-vector-icons’ with semitransparent color, this icon is passed into ‘as’ property on native-base icon, this icon will never flicker
  3. First icon is native-base icon with usage of ‘as’ property, this icon has semitransparent color, this icon will start to flicker on render (refresh button) whenever layout animation occurs in app
  4. Taping Refresh button causes rerender
  5. On first screen if you tap on refresh, no flicker occurs, when you switch to second tab, layout animation is triggered, causing renders to flicker third icon, when you navigate back to the first tab, third icon will be flickering as well.

Snack or a link to a repository

https://snack.expo.dev/@krygelv/flickeringicon

Reanimated version

2.13.0

React Native version

0.68.2

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

One Plus 9 pro OxygenOS 13.0

Acknowledgements

Yes

szydlovsky commented 1 week ago

Checked your example as well as made a few of my own - the problem is no longer there:) (Reanimated 3.12.1)