react / react/react-native

MVCP rendering issues in Flatlist on Android

Ouverte
#56,866 4 commentaires 2 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Component: FlatList Needs: Triage :mag: Platform: Android Type: New Architecture
Langage dominant
C++
Étoiles
127k
Forks
25.3k
Merge moyen
1 j 23 h
PR mergées (30 j)
4

Description

Description

When adding items in a flatlist with dynamic heights and having animations with MaintainVisibleContentPosition, there's jittering on the flatlist.

After slowing down the video, i found the flatlist renders the new item in one frame, then removes it and then animates it in properly.

I believe the root cause to be the new fabric engine as this was working on a previous version without new architecture.

I did find 2 potential fixes:

  1. Setting a static height on the items, pointing the issue to only variable height items
  2. Setting enableFabricCommitBranching to true, but this caused an issue with react navigation/screens going back, where the screen would unrender before the new one finished animating in.
Steps to reproduce
  1. Install the reproductiion app on android
  2. npm install
  3. npm run android
  4. Press "Add" multiple times at least 5, notice the jank in the animation
React Native Version

0.85.3

Affected Platforms

Runtime - Android

Areas

Fabric - The New Renderer

Output of npx @react-native-community/cli info
System:
  OS: macOS 26.4.1
  CPU: (16) arm64 Apple M3 Max
  Memory: 3.33 GB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 25.9.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.19
    path: /Users/humaid/.nvm/versions/node/v24.14.1/bin/yarn
  npm:
    version: 11.12.1
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2026.01.12.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.5
      - iOS 26.5
      - macOS 26.5
      - tvOS 26.5
      - visionOS 26.5
      - watchOS 26.5
  Android SDK:
    API Levels:
      - "30"
      - "34"
      - "35"
      - "36"
      - "37"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2025.3 AI-253.30387.90.2532.14935130
  Xcode:
    version: 26.5/17F42
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.11
    path: /Users/humaid/Library/Java/JavaVirtualMachines/azul-21.0.11/Contents/Home/bin/javac
  Ruby:
    version: 3.3.5
    path: /Users/humaid/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.0
    wanted: 20.1.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.85.3
    wanted: 0.85.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
No Stack trace
MANDATORY Reproducer

https://github.com/humaidk2/MVCPrepro

Screenshots and Videos

Normal video

https://github.com/user-attachments/assets/e107378d-c108-4423-9a77-18815d6addf9

Slowed down to 10%

https://github.com/user-attachments/assets/8e3a6889-5166-4ca4-a295-874c5b7f9819

Slowed down to 5%

https://github.com/user-attachments/assets/80e6a927-d32d-4bc8-a985-200177413752

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le reproducteur obligatoire à l’adresse https://github.com/humaidk2/MVCPrepro : exécutez npm install et npm run android, puis reproduisez le scintillement sur Android en appuyant plusieurs fois sur « Add ». Étudiez le comportement de Flatlist lié aux hauteurs dynamiques, à MaintainVisibleContentPosition et à Fabric ; le travail est terminé lorsque le nouvel élément ajouté ne s’affiche plus brièvement, ne disparaît plus, puis ne s’anime plus à nouveau.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
android, react-native
Domaine
mobile, performance
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
À clarifier
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.