Skip to content

Animation freeze / lags when using animated FlatList #1792

@likern

Description

@likern

Description

If I use Animated FlatList Animated.createAnimatedComponent(FlatList) I see considerable animation freezes and lags.

Details

I'm implementing the new calendar component https://github.com/breeffy/react-native-monorepo based on Reanimated v2.
The main idea is to have high-performant animations (like header month-year) purely based on scrolling position.

All calculations for animating things is done on UI thread using Reanimated v2 https://github.com/breeffy/react-native-monorepo/blob/20e503f3804d3945d5369d1d07a76b37ee10ead3/packages/calendars/src/CalendarScrollableMonths.tsx#L88

But still, when new month rendering happens I see animation freezes and lags. I can see it even on slow scrolling.

Screenshots

Screenrecorder-2021-03-05-19-40-45-338.mp4

Steps To Reproduce

Run example app in monorepo (it contains component with issue).

Expected behavior

Animation on UI thread should not freeze if rendering / rerendering happens on JS thread.

Actual behavior

Animation freezes when additional components are rendered on JS thread using FlatList.

Snack or minimal code example

This branch breeffy/react-native-monorepo#151 contains example application with reproduced issue.

Device

  • Phone: Xiaomi Mi9T Pro
  • OS: Android 10

Affected platforms

  • OS: Android (not tested on iOS)

Package versions

  • React: 16.13.1
  • React Native: 0.63.4
  • React Native Reanimated: 2.0.0
  • NodeJS: 10.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugClose when staleThis issue is going to be closed when there is no activity for a whilebug-bash-jan22Issues visited during Bug Bash Jan 2022

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions