facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.77k stars 24.15k forks source link

Animated.FlatList prop contentContainerStyle doesn't handle animated values #32192

Open reichhartd opened 2 years ago

reichhartd commented 2 years ago

Description

As I noted in the heading, the Animated.FlatList component does not accept animated values for the contentContainerStyle property. It only seems to work for style. This is not the behaviour one would expect from an animated component and should be changed.

React Native version:

System:
    OS: macOS 11.5.2
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 196.01 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.6 - /usr/local/opt/node@14/bin/node
    Yarn: 1.22.11 - /usr/local/bin/yarn
    npm: 6.14.15 - /usr/local/opt/node@14/bin/npm
    Watchman: 2021.09.06.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK:
      API Levels: 28, 29, 30, 31
      Build Tools: 29.0.2, 30.0.2, 31.0.0
      System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Arctic Fox 2020.3.1 Arctic Fox 2020.3.1
    Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.65.1 => 0.65.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Add Animated.FlatList with some sample data to your app
  2. Try to pass an animated value to contentContainerStyle

Expected Results

I would expect this to work with one of the animated components, but instead the screen freezes.

Snack, code example, screenshot, or link to a repository:

https://snack.expo.dev/@reichhartd/animated_flatlist-example

stale[bot] commented 2 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

reichhartd commented 2 years ago

@stale Yes, please leave it open.

cleidsond commented 1 year ago

I am having the same issue.

vnmomodangnguyen7 commented 1 month ago

i have the same issue